<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Hardware Abstraction Layer (HAL)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="logo.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Hardware Abstraction Layer (HAL)</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__group__hal__i2c.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#groups">API Reference</a> &#124;
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">I2C (Inter-Integrated Circuit)<div class="ingroups"><a class="el" href="group__group__hal.html">HAL Drivers</a></div></div></div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p >High level interface for interacting with the I2C resource. </p>
<p >The I2C protocol is a synchronous serial interface protocol. This driver supports both master and slave mode of operation. The communication frequency and address (for slave operation) can be configured.</p>
<h1><a class="anchor" id="section_i2c_features"></a>
Features</h1>
<ul>
<li>Master or slave functionality</li>
<li>Configurable slave address</li>
<li>Configurable data rates</li>
<li>Configurable interrupt and callback assignment from I2C events - <a class="el" href="group__group__hal__i2c.html#gaaba7daccaa3861c32a4b0284e8194a79">cyhal_i2c_event_t</a></li>
</ul>
<h1><a class="anchor" id="section_i2c_quickstart"></a>
Quick Start</h1>
<p >Initialize an I2C instance using the <a class="el" href="group__group__hal__i2c.html#gac2885a21905af9d1d48aae34a6032a61">cyhal_i2c_init</a> and provide <b>sda</b> (I2C data) and <b>scl</b> (I2C clock) pins.<br  />
 By default, this initializes the resource as an I2C master.<br  />
 Configure the behavior (master/slave) and the interface (bus frequency, slave address) using the <a class="el" href="group__group__hal__i2c.html#ga37a35abcb9bf2d0ecf2a52b2fa5bce64">cyhal_i2c_configure</a> function. <br  />
 See <a class="el" href="group__group__hal__i2c.html#subsection_i2c_snippet_1">Snippet 1: I2C Initialization and Configuration</a> for example initialization as master or slave. </p><dl class="section note"><dt>Note</dt><dd>The clock parameter (const cyhal_clock_divider_t *clk) is optional and can be set to NULL to generate and use an available clock resource with a default frequency (CYHAL_I2C_MASTER_DEFAULT_FREQ).</dd></dl>
<h1><a class="anchor" id="section_i2c_snippets"></a>
Code Snippets</h1>
<h2><a class="anchor" id="subsection_i2c_snippet_1"></a>
Snippet 1: I2C Initialization and Configuration</h2>
<p >This snippet initializes an I2C resource as master or slave and assigns the <b>sda</b> and <b>scl</b> pins.</p>
<p >Initializing as I2C master </p><div class="fragment"><div class="line">    <span class="comment">// Declare variables</span></div>
<div class="line">    <a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>   rslt;</div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> i2c_master_obj;</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Define frequency</span></div>
<div class="line">    uint32_t I2C_MASTER_FREQUENCY = 100000u;</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Define the I2C master configuration structure</span></div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__i2c.html#structcyhal__i2c__cfg__t">cyhal_i2c_cfg_t</a> i2c_master_config =</div>
<div class="line">    {</div>
<div class="line">        <a class="code hl_define" href="group__group__hal__i2c.html#gae8ce31deae8ac6078af98b52249e0089">CYHAL_I2C_MODE_MASTER</a>,</div>
<div class="line">        0, <span class="comment">// address is not used for master mode</span></div>
<div class="line">        I2C_MASTER_FREQUENCY</div>
<div class="line">    };</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Initialize I2C master, set the SDA and SCL pins and assign a new clock</span></div>
<div class="line">    rslt = <a class="code hl_function" href="group__group__hal__i2c.html#gac2885a21905af9d1d48aae34a6032a61">cyhal_i2c_init</a>(&amp;i2c_master_obj, CYBSP_I2C_SDA, CYBSP_I2C_SCL, NULL);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Configure the I2C resource to be master</span></div>
<div class="line">    rslt = <a class="code hl_function" href="group__group__hal__i2c.html#ga37a35abcb9bf2d0ecf2a52b2fa5bce64">cyhal_i2c_configure</a>(&amp;i2c_master_obj, &amp;i2c_master_config);</div>
<div class="ttc" id="agroup__group__hal__i2c_html_ga37a35abcb9bf2d0ecf2a52b2fa5bce64"><div class="ttname"><a href="group__group__hal__i2c.html#ga37a35abcb9bf2d0ecf2a52b2fa5bce64">cyhal_i2c_configure</a></div><div class="ttdeci">cy_rslt_t cyhal_i2c_configure(cyhal_i2c_t *obj, const cyhal_i2c_cfg_t *cfg)</div><div class="ttdoc">Configure the I2C block.</div></div>
<div class="ttc" id="agroup__group__hal__i2c_html_gac2885a21905af9d1d48aae34a6032a61"><div class="ttname"><a href="group__group__hal__i2c.html#gac2885a21905af9d1d48aae34a6032a61">cyhal_i2c_init</a></div><div class="ttdeci">cy_rslt_t cyhal_i2c_init(cyhal_i2c_t *obj, cyhal_gpio_t sda, cyhal_gpio_t scl, const cyhal_clock_t *clk)</div><div class="ttdoc">Initialize the I2C peripheral, and configures its specified pins.</div></div>
<div class="ttc" id="agroup__group__hal__i2c_html_gae8ce31deae8ac6078af98b52249e0089"><div class="ttname"><a href="group__group__hal__i2c.html#gae8ce31deae8ac6078af98b52249e0089">CYHAL_I2C_MODE_MASTER</a></div><div class="ttdeci">#define CYHAL_I2C_MODE_MASTER</div><div class="ttdoc">Named define for Master mode for use when initializing the cyhal_i2c_cfg_t structure.</div><div class="ttdef"><b>Definition:</b> cyhal_i2c.h:161</div></div>
<div class="ttc" id="agroup__group__hal__i2c_html_structcyhal__i2c__cfg__t"><div class="ttname"><a href="group__group__hal__i2c.html#structcyhal__i2c__cfg__t">cyhal_i2c_cfg_t</a></div><div class="ttdoc">Initial I2C configuration.</div><div class="ttdef"><b>Definition:</b> cyhal_i2c.h:220</div></div>
<div class="ttc" id="agroup__group__hal__impl__hw__types_html_structcyhal__i2c__t"><div class="ttname"><a href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a></div><div class="ttdoc">I2C object.</div><div class="ttdef"><b>Definition:</b> cyhal_hw_types.h:732</div></div>
<div class="ttc" id="agroup__group__result_html_gaca79700fcc701534ce61778a9bcf57d1"><div class="ttname"><a href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a></div><div class="ttdeci">uint32_t cy_rslt_t</div><div class="ttdoc">Provides the result of an operation as a structured bitfield.</div><div class="ttdef"><b>Definition:</b> cy_result.h:438</div></div>
</div><!-- fragment --><p >Initializing as I2C slave </p><div class="fragment"><div class="line">    <span class="comment">// Declare variables</span></div>
<div class="line">    <a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>   rslt;</div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> i2c_slave_obj;</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Define address</span></div>
<div class="line">    uint16_t I2C_SLAVE_ADDRESS = 0x08u;</div>
<div class="line">    <span class="comment">// Define address mask</span></div>
<div class="line">    uint16_t I2C_SLAVE_ADDRESS_MASK = 0xFEu;</div>
<div class="line">    <span class="comment">// Define frequency</span></div>
<div class="line">    uint32_t I2C_SLAVE_FREQUENCY = 100000u;</div>
<div class="line">    <span class="comment">// Define address is in FIFO or not</span></div>
<div class="line">    <span class="keywordtype">bool</span> I2C_ENABLE_ADDRESS_EVENT = <span class="keyword">false</span>;</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Define the slave configuration structure</span></div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__i2c.html#structcyhal__i2c__cfg__t">cyhal_i2c_cfg_t</a> i2c_slave_config =</div>
<div class="line">        { <a class="code hl_define" href="group__group__hal__i2c.html#gad2ea1e12f91892dfd0d6695b11f1d4a5">CYHAL_I2C_MODE_SLAVE</a>, I2C_SLAVE_ADDRESS, I2C_SLAVE_FREQUENCY };</div>
<div class="line"> </div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__i2c.html#structcyhal__i2c__adv__cfg__t">cyhal_i2c_adv_cfg_t</a> i2c_slave_advanced_config =</div>
<div class="line">        { i2c_slave_config, I2C_SLAVE_ADDRESS_MASK, I2C_ENABLE_ADDRESS_EVENT };</div>
<div class="line">    <span class="comment">// Initialize I2C slave, set the SDA and SCL pins and assign a new clock</span></div>
<div class="line">    rslt = <a class="code hl_function" href="group__group__hal__i2c.html#gac2885a21905af9d1d48aae34a6032a61">cyhal_i2c_init</a>(&amp;i2c_slave_obj, CYBSP_I2C_SDA, CYBSP_I2C_SCL, NULL);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Configure the I2C resource to be slave</span></div>
<div class="line">    rslt = <a class="code hl_function" href="group__group__hal__i2c.html#ga37a35abcb9bf2d0ecf2a52b2fa5bce64">cyhal_i2c_configure</a>(&amp;i2c_slave_obj, &amp;i2c_slave_config);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Advanced configuration of the I2C resource to be slave</span></div>
<div class="line">    rslt = <a class="code hl_function" href="group__group__hal__i2c.html#ga374725474725fa84841feedf11eb5359">cyhal_i2c_configure_adv</a>(&amp;i2c_slave_obj, &amp;i2c_slave_advanced_config);</div>
<div class="line"> </div>
<div class="ttc" id="agroup__group__hal__i2c_html_ga374725474725fa84841feedf11eb5359"><div class="ttname"><a href="group__group__hal__i2c.html#ga374725474725fa84841feedf11eb5359">cyhal_i2c_configure_adv</a></div><div class="ttdeci">cy_rslt_t cyhal_i2c_configure_adv(cyhal_i2c_t *obj, const cyhal_i2c_adv_cfg_t *cfg)</div><div class="ttdoc">Configure the I2C block with advanced parameters.</div></div>
<div class="ttc" id="agroup__group__hal__i2c_html_gad2ea1e12f91892dfd0d6695b11f1d4a5"><div class="ttname"><a href="group__group__hal__i2c.html#gad2ea1e12f91892dfd0d6695b11f1d4a5">CYHAL_I2C_MODE_SLAVE</a></div><div class="ttdeci">#define CYHAL_I2C_MODE_SLAVE</div><div class="ttdoc">Named define for Slave mode for use when initializing the cyhal_i2c_cfg_t structure.</div><div class="ttdef"><b>Definition:</b> cyhal_i2c.h:159</div></div>
<div class="ttc" id="agroup__group__hal__i2c_html_structcyhal__i2c__adv__cfg__t"><div class="ttname"><a href="group__group__hal__i2c.html#structcyhal__i2c__adv__cfg__t">cyhal_i2c_adv_cfg_t</a></div><div class="ttdoc">I2C advanced configuration.</div><div class="ttdef"><b>Definition:</b> cyhal_i2c.h:229</div></div>
</div><!-- fragment --><h2><a class="anchor" id="subsection_i2c_snippet_2"></a>
Snippet 2: Handling events</h2>
<p >This snippet shows how to enable and handle I2C events using <a class="el" href="group__group__hal__i2c.html#ga6216658331d13dd8a854a23e96141fc7">cyhal_i2c_enable_event</a> and <a class="el" href="group__group__hal__i2c.html#gacf738716af52c484873e35331b9a30b7">cyhal_i2c_register_callback</a>.<br  />
 The <b>callback</b> parameter of <a class="el" href="group__group__hal__i2c.html#gacf738716af52c484873e35331b9a30b7">cyhal_i2c_register_callback</a> is used to pass the callback handler that will be invoked when an event occurs.<br  />
 The <b>event</b> parameter of <a class="el" href="group__group__hal__i2c.html#ga6216658331d13dd8a854a23e96141fc7">cyhal_i2c_enable_event</a> is used to pass the bitmasks of events ( <a class="el" href="group__group__hal__i2c.html#gaaba7daccaa3861c32a4b0284e8194a79">cyhal_i2c_event_t</a>) to be enabled.</p>
<div class="fragment"><div class="line"> </div>
<div class="line"><span class="keywordtype">void</span> handle_i2c_events(<span class="keywordtype">void</span>* callback_arg, <a class="code hl_enumeration" href="group__group__hal__i2c.html#gaaba7daccaa3861c32a4b0284e8194a79">cyhal_i2c_event_t</a> event)</div>
<div class="line">{</div>
<div class="line">    <span class="comment">// To remove unused variable warning</span></div>
<div class="line">    (void)callback_arg;</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Check write complete event</span></div>
<div class="line">    <span class="keywordflow">if</span> (0UL != (<a class="code hl_enumvalue" href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79aed43708fe51a3270699f80f21dde4bac">CYHAL_I2C_SLAVE_WR_CMPLT_EVENT</a> &amp; event))</div>
<div class="line">    {</div>
<div class="line">        <span class="comment">// Perform the required functions</span></div>
<div class="line">    }</div>
<div class="line">    <span class="comment">// Check read complete event</span></div>
<div class="line">    <span class="keywordflow">if</span> (0UL != (<a class="code hl_enumvalue" href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79af3743e0bae6fc016ae15741d69b765e8">CYHAL_I2C_SLAVE_RD_CMPLT_EVENT</a> &amp; event))</div>
<div class="line">    {</div>
<div class="line">        <span class="comment">// Perform the required functions</span></div>
<div class="line">    }</div>
<div class="line">    <span class="comment">// Check for errors</span></div>
<div class="line">    <span class="keywordflow">if</span> (0UL == (<a class="code hl_enumvalue" href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79aba7cb8e07c8f47bd41a74af1373c7d04">CYHAL_I2C_SLAVE_ERR_EVENT</a> &amp; event))</div>
<div class="line">    {</div>
<div class="line">        <span class="comment">// Perform the required function</span></div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><a class="code hl_enumeration" href="group__group__hal__i2c.html#gab8cea7222ae651a94ac82b9ed74e6458">cyhal_i2c_command_rsp_t</a> handle_i2c_address_events(<span class="keywordtype">void</span>* callback_arg, <a class="code hl_enumeration" href="group__group__hal__i2c.html#ga10f472dd5ea523332e85610d903a020c">cyhal_i2c_addr_event_t</a> event,</div>
<div class="line">                                                  uint8_t device_address)</div>
<div class="line">{</div>
<div class="line">    <span class="comment">// To remove unused variable warning</span></div>
<div class="line">    (void)callback_arg;</div>
<div class="line">    (void)device_address;</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Check write complete event</span></div>
<div class="line">    <span class="keywordflow">if</span> (0UL != (<a class="code hl_enumvalue" href="group__group__hal__i2c.html#gga10f472dd5ea523332e85610d903a020ca41f1138ead03bf6036d4c6619fd3cced">CYHAL_I2C_GENERAL_CALL_EVENT</a> &amp; event))</div>
<div class="line">    {</div>
<div class="line">        <span class="comment">// Perform the required functions</span></div>
<div class="line">    }</div>
<div class="line">    <span class="comment">// Check read complete event</span></div>
<div class="line">    <span class="keywordflow">if</span> (0UL != (<a class="code hl_enumvalue" href="group__group__hal__i2c.html#gga10f472dd5ea523332e85610d903a020ca6375d0f8ef5d6bf5ed82ad519db8b8a7">CYHAL_I2C_ADDR_MATCH_EVENT</a> &amp; event))</div>
<div class="line">    {</div>
<div class="line">        <span class="comment">// Perform the required functions</span></div>
<div class="line">    }</div>
<div class="line">    <span class="keywordflow">return</span> <a class="code hl_enumvalue" href="group__group__hal__i2c.html#ggab8cea7222ae651a94ac82b9ed74e6458a6be97c5798dd2d782492c37e1eeb9db3">CYHAL_I2C_CMD_ACK</a>;</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> snippet_cyhal_i2c_slave_callback_init()</div>
<div class="line">{</div>
<div class="line">    <span class="comment">// Declare variables</span></div>
<div class="line">    <a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>   rslt;</div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> i2c_slave_obj;</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Define the slave configuration structure</span></div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__i2c.html#structcyhal__i2c__cfg__t">cyhal_i2c_cfg_t</a> i2c_slave_config = { <a class="code hl_define" href="group__group__hal__i2c.html#gad2ea1e12f91892dfd0d6695b11f1d4a5">CYHAL_I2C_MODE_SLAVE</a>, 0x08u, 100000u };</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Initialize I2C slave, set the SDA and SCL pins and assign a new clock</span></div>
<div class="line">    rslt = <a class="code hl_function" href="group__group__hal__i2c.html#gac2885a21905af9d1d48aae34a6032a61">cyhal_i2c_init</a>(&amp;i2c_slave_obj, CYBSP_I2C_SDA, CYBSP_I2C_SCL, NULL);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Configure the I2C resource to be slave</span></div>
<div class="line">    <span class="keywordflow">if</span> (<a class="code hl_define" href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a> == rslt)</div>
<div class="line">    {</div>
<div class="line">        rslt = <a class="code hl_function" href="group__group__hal__i2c.html#ga37a35abcb9bf2d0ecf2a52b2fa5bce64">cyhal_i2c_configure</a>(&amp;i2c_slave_obj, &amp;i2c_slave_config);</div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">if</span> (<a class="code hl_define" href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a> == rslt)</div>
<div class="line">    {</div>
<div class="line">        <span class="comment">// Register I2C slave event callback</span></div>
<div class="line">        <a class="code hl_function" href="group__group__hal__i2c.html#gacf738716af52c484873e35331b9a30b7">cyhal_i2c_register_callback</a>(&amp;i2c_slave_obj, (<a class="code hl_typedef" href="group__group__hal__i2c.html#ga67df812388aae9fcc3b3b1986dab7a09">cyhal_i2c_event_callback_t</a>)handle_i2c_events,</div>
<div class="line">                                    NULL);</div>
<div class="line"> </div>
<div class="line">        <span class="comment">// Enable I2C Events</span></div>
<div class="line">        <a class="code hl_function" href="group__group__hal__i2c.html#ga6216658331d13dd8a854a23e96141fc7">cyhal_i2c_enable_event</a>(&amp;i2c_slave_obj, (<a class="code hl_enumeration" href="group__group__hal__i2c.html#gaaba7daccaa3861c32a4b0284e8194a79">cyhal_i2c_event_t</a>)   \</div>
<div class="line">                               (<a class="code hl_enumvalue" href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79aed43708fe51a3270699f80f21dde4bac">CYHAL_I2C_SLAVE_WR_CMPLT_EVENT</a> \</div>
<div class="line">                                | <a class="code hl_enumvalue" href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79af3743e0bae6fc016ae15741d69b765e8">CYHAL_I2C_SLAVE_RD_CMPLT_EVENT</a> \</div>
<div class="line">                                | <a class="code hl_enumvalue" href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79aba7cb8e07c8f47bd41a74af1373c7d04">CYHAL_I2C_SLAVE_ERR_EVENT</a>),    \</div>
<div class="line">                               3u, <span class="keyword">true</span>);</div>
<div class="line"> </div>
<div class="line">        <span class="comment">// Register I2C slave address callback</span></div>
<div class="line">        <a class="code hl_function" href="group__group__hal__i2c.html#gaafc998a7480459a782345d4c20317072">cyhal_i2c_register_address_callback</a>(&amp;i2c_slave_obj,</div>
<div class="line">                                            (<a class="code hl_typedef" href="group__group__hal__i2c.html#gaf1b10084a21b85fbc040238f0c205782">cyhal_i2c_address_callback_t</a>)handle_i2c_address_events,</div>
<div class="line">                                            NULL);</div>
<div class="line"> </div>
<div class="line">        <span class="comment">// Enable I2C Address Events</span></div>
<div class="line">        <a class="code hl_function" href="group__group__hal__i2c.html#ga580008770cd8c2dfcc7c919d25ba9904">cyhal_i2c_enable_address_event</a>(&amp;i2c_slave_obj, (<a class="code hl_enumeration" href="group__group__hal__i2c.html#ga10f472dd5ea523332e85610d903a020c">cyhal_i2c_addr_event_t</a>)   \</div>
<div class="line">                                       (<a class="code hl_enumvalue" href="group__group__hal__i2c.html#gga10f472dd5ea523332e85610d903a020ca6375d0f8ef5d6bf5ed82ad519db8b8a7">CYHAL_I2C_ADDR_MATCH_EVENT</a>),    \</div>
<div class="line">                                       3u, <span class="keyword">true</span>);</div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">return</span> rslt;</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="ttc" id="agroup__group__hal__i2c_html_ga10f472dd5ea523332e85610d903a020c"><div class="ttname"><a href="group__group__hal__i2c.html#ga10f472dd5ea523332e85610d903a020c">cyhal_i2c_addr_event_t</a></div><div class="ttdeci">cyhal_i2c_addr_event_t</div><div class="ttdoc">Enum to enable/disable/report address interrupt cause flags.</div><div class="ttdef"><b>Definition:</b> cyhal_i2c.h:186</div></div>
<div class="ttc" id="agroup__group__hal__i2c_html_ga580008770cd8c2dfcc7c919d25ba9904"><div class="ttname"><a href="group__group__hal__i2c.html#ga580008770cd8c2dfcc7c919d25ba9904">cyhal_i2c_enable_address_event</a></div><div class="ttdeci">void cyhal_i2c_enable_address_event(cyhal_i2c_t *obj, cyhal_i2c_addr_event_t event, uint8_t intr_priority, bool enable)</div><div class="ttdoc">Configure and Enable or Disable I2C Address Interrupt.</div></div>
<div class="ttc" id="agroup__group__hal__i2c_html_ga6216658331d13dd8a854a23e96141fc7"><div class="ttname"><a href="group__group__hal__i2c.html#ga6216658331d13dd8a854a23e96141fc7">cyhal_i2c_enable_event</a></div><div class="ttdeci">void cyhal_i2c_enable_event(cyhal_i2c_t *obj, cyhal_i2c_event_t event, uint8_t intr_priority, bool enable)</div><div class="ttdoc">Configure and Enable or Disable I2C Interrupt.</div></div>
<div class="ttc" id="agroup__group__hal__i2c_html_ga67df812388aae9fcc3b3b1986dab7a09"><div class="ttname"><a href="group__group__hal__i2c.html#ga67df812388aae9fcc3b3b1986dab7a09">cyhal_i2c_event_callback_t</a></div><div class="ttdeci">void(* cyhal_i2c_event_callback_t)(void *callback_arg, cyhal_i2c_event_t event)</div><div class="ttdoc">Handler for I2C events.</div><div class="ttdef"><b>Definition:</b> cyhal_i2c.h:214</div></div>
<div class="ttc" id="agroup__group__hal__i2c_html_gaaba7daccaa3861c32a4b0284e8194a79"><div class="ttname"><a href="group__group__hal__i2c.html#gaaba7daccaa3861c32a4b0284e8194a79">cyhal_i2c_event_t</a></div><div class="ttdeci">cyhal_i2c_event_t</div><div class="ttdoc">Enum to enable/disable/report interrupt cause flags.</div><div class="ttdef"><b>Definition:</b> cyhal_i2c.h:169</div></div>
<div class="ttc" id="agroup__group__hal__i2c_html_gaafc998a7480459a782345d4c20317072"><div class="ttname"><a href="group__group__hal__i2c.html#gaafc998a7480459a782345d4c20317072">cyhal_i2c_register_address_callback</a></div><div class="ttdeci">void cyhal_i2c_register_address_callback(cyhal_i2c_t *obj, cyhal_i2c_address_callback_t callback, void *callback_arg)</div><div class="ttdoc">Register an I2C address callback handler</div></div>
<div class="ttc" id="agroup__group__hal__i2c_html_gab8cea7222ae651a94ac82b9ed74e6458"><div class="ttname"><a href="group__group__hal__i2c.html#gab8cea7222ae651a94ac82b9ed74e6458">cyhal_i2c_command_rsp_t</a></div><div class="ttdeci">cyhal_i2c_command_rsp_t</div><div class="ttdoc">I2C Command ACK / NAK.</div><div class="ttdef"><b>Definition:</b> cyhal_i2c.h:201</div></div>
<div class="ttc" id="agroup__group__hal__i2c_html_gacf738716af52c484873e35331b9a30b7"><div class="ttname"><a href="group__group__hal__i2c.html#gacf738716af52c484873e35331b9a30b7">cyhal_i2c_register_callback</a></div><div class="ttdeci">void cyhal_i2c_register_callback(cyhal_i2c_t *obj, cyhal_i2c_event_callback_t callback, void *callback_arg)</div><div class="ttdoc">Register an I2C event callback handler</div></div>
<div class="ttc" id="agroup__group__hal__i2c_html_gaf1b10084a21b85fbc040238f0c205782"><div class="ttname"><a href="group__group__hal__i2c.html#gaf1b10084a21b85fbc040238f0c205782">cyhal_i2c_address_callback_t</a></div><div class="ttdeci">cyhal_i2c_command_rsp_t(* cyhal_i2c_address_callback_t)(void *callback_arg, cyhal_i2c_addr_event_t event, uint8_t address)</div><div class="ttdoc">Handler for I2C address events.</div><div class="ttdef"><b>Definition:</b> cyhal_i2c.h:216</div></div>
<div class="ttc" id="agroup__group__hal__i2c_html_gga10f472dd5ea523332e85610d903a020ca41f1138ead03bf6036d4c6619fd3cced"><div class="ttname"><a href="group__group__hal__i2c.html#gga10f472dd5ea523332e85610d903a020ca41f1138ead03bf6036d4c6619fd3cced">CYHAL_I2C_GENERAL_CALL_EVENT</a></div><div class="ttdeci">@ CYHAL_I2C_GENERAL_CALL_EVENT</div><div class="ttdoc">Indicates the slave was addressed by the general call address.</div><div class="ttdef"><b>Definition:</b> cyhal_i2c.h:188</div></div>
<div class="ttc" id="agroup__group__hal__i2c_html_gga10f472dd5ea523332e85610d903a020ca6375d0f8ef5d6bf5ed82ad519db8b8a7"><div class="ttname"><a href="group__group__hal__i2c.html#gga10f472dd5ea523332e85610d903a020ca6375d0f8ef5d6bf5ed82ad519db8b8a7">CYHAL_I2C_ADDR_MATCH_EVENT</a></div><div class="ttdeci">@ CYHAL_I2C_ADDR_MATCH_EVENT</div><div class="ttdoc">Indicates the slave matching address received.</div><div class="ttdef"><b>Definition:</b> cyhal_i2c.h:189</div></div>
<div class="ttc" id="agroup__group__hal__i2c_html_ggaaba7daccaa3861c32a4b0284e8194a79aba7cb8e07c8f47bd41a74af1373c7d04"><div class="ttname"><a href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79aba7cb8e07c8f47bd41a74af1373c7d04">CYHAL_I2C_SLAVE_ERR_EVENT</a></div><div class="ttdeci">@ CYHAL_I2C_SLAVE_ERR_EVENT</div><div class="ttdoc">Indicates the I2C hardware detected an error.</div><div class="ttdef"><b>Definition:</b> cyhal_i2c.h:177</div></div>
<div class="ttc" id="agroup__group__hal__i2c_html_ggaaba7daccaa3861c32a4b0284e8194a79aed43708fe51a3270699f80f21dde4bac"><div class="ttname"><a href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79aed43708fe51a3270699f80f21dde4bac">CYHAL_I2C_SLAVE_WR_CMPLT_EVENT</a></div><div class="ttdeci">@ CYHAL_I2C_SLAVE_WR_CMPLT_EVENT</div><div class="ttdoc">Indicates the master completed writing to the slave (set by the master Stop or Restart)</div><div class="ttdef"><b>Definition:</b> cyhal_i2c.h:176</div></div>
<div class="ttc" id="agroup__group__hal__i2c_html_ggaaba7daccaa3861c32a4b0284e8194a79af3743e0bae6fc016ae15741d69b765e8"><div class="ttname"><a href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79af3743e0bae6fc016ae15741d69b765e8">CYHAL_I2C_SLAVE_RD_CMPLT_EVENT</a></div><div class="ttdeci">@ CYHAL_I2C_SLAVE_RD_CMPLT_EVENT</div><div class="ttdoc">Indicates the master completed reading from the slave (set by the master NAK or Stop)</div><div class="ttdef"><b>Definition:</b> cyhal_i2c.h:175</div></div>
<div class="ttc" id="agroup__group__hal__i2c_html_ggab8cea7222ae651a94ac82b9ed74e6458a6be97c5798dd2d782492c37e1eeb9db3"><div class="ttname"><a href="group__group__hal__i2c.html#ggab8cea7222ae651a94ac82b9ed74e6458a6be97c5798dd2d782492c37e1eeb9db3">CYHAL_I2C_CMD_ACK</a></div><div class="ttdeci">@ CYHAL_I2C_CMD_ACK</div><div class="ttdoc">Send ACK to current byte.</div><div class="ttdef"><b>Definition:</b> cyhal_i2c.h:202</div></div>
<div class="ttc" id="agroup__group__result_html_gaf58fac450d9fff4472f03ad68f6e546e"><div class="ttname"><a href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a></div><div class="ttdeci">#define CY_RSLT_SUCCESS</div><div class="ttdoc">cy_rslt_t return value indicating success</div><div class="ttdef"><b>Definition:</b> cy_result.h:465</div></div>
</div><!-- fragment --><h2><a class="anchor" id="subsection_i2c_snippet_3"></a>
Snippet 3: I2C Master Asynchronous Transfer</h2>
<p >This snippet shows how to implement asynchronous transfers using <a class="el" href="group__group__hal__i2c.html#gad6cd59cead5f7de0cf87571ceb656054">cyhal_i2c_master_transfer_async</a>.<br  />
 <a class="el" href="group__group__hal__i2c.html#ga5ee41d9e5c6dc83376291ff5275c942a">cyhal_i2c_abort_async</a> is used to stop the transfer, in this case when an error occurs.</p>
<div class="fragment"><div class="line"><span class="comment">// Declare variables</span></div>
<div class="line"><a class="code hl_struct" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> i2c_master_obj;</div>
<div class="line">uint8_t     tx_buff[3] = { 1, 2, 3 };</div>
<div class="line">uint8_t     rx_buff[3];</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Defining master callback handler</span></div>
<div class="line"><span class="keywordtype">void</span> master_event_handler(<span class="keywordtype">void</span>* callback_arg, <a class="code hl_enumeration" href="group__group__hal__i2c.html#gaaba7daccaa3861c32a4b0284e8194a79">cyhal_i2c_event_t</a> event)</div>
<div class="line">{</div>
<div class="line">    <span class="comment">// To remove unused variable warning</span></div>
<div class="line">    (void)callback_arg;</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Check write complete event</span></div>
<div class="line">    <span class="keywordflow">if</span> (0UL != (<a class="code hl_enumvalue" href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79a0365270204869bfe80a2015258c979e1">CYHAL_I2C_MASTER_WR_CMPLT_EVENT</a> &amp; event))</div>
<div class="line">    {</div>
<div class="line">        <span class="comment">// Perform the required functions</span></div>
<div class="line">    }</div>
<div class="line">    <span class="comment">// Check read complete event</span></div>
<div class="line">    <span class="keywordflow">if</span> (0UL != (<a class="code hl_enumvalue" href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79ac5b8050af1c08b0d00a21539c5286435">CYHAL_I2C_MASTER_RD_CMPLT_EVENT</a> &amp; event))</div>
<div class="line">    {</div>
<div class="line">        <span class="comment">// Perform the required functions</span></div>
<div class="line">    }</div>
<div class="line">    <span class="keywordflow">if</span> (0UL != (<a class="code hl_enumvalue" href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79a4bda40d48c2d7ca1c7556367b532920f">CYHAL_I2C_MASTER_ERR_EVENT</a> &amp; event))</div>
<div class="line">    {</div>
<div class="line">        <span class="comment">// In case of error abort transfer</span></div>
<div class="line">        <a class="code hl_function" href="group__group__hal__i2c.html#ga5ee41d9e5c6dc83376291ff5275c942a">cyhal_i2c_abort_async</a>(&amp;i2c_master_obj);</div>
<div class="line">    }</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> snippet_cyhal_async_transfer(<span class="keywordtype">void</span>)</div>
<div class="line">{</div>
<div class="line">    <a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> rslt;</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Define address</span></div>
<div class="line">    uint16_t I2C_SLAVE_ADDRESS = 0x08u;</div>
<div class="line">    <span class="comment">// Define frequency</span></div>
<div class="line">    uint32_t I2C_MASTER_FREQUENCY = 100000u;</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Configure I2C Master</span></div>
<div class="line">    <a class="code hl_struct" href="group__group__hal__i2c.html#structcyhal__i2c__cfg__t">cyhal_i2c_cfg_t</a> i2c_master_config = { <a class="code hl_define" href="group__group__hal__i2c.html#gae8ce31deae8ac6078af98b52249e0089">CYHAL_I2C_MODE_MASTER</a>, 0, I2C_MASTER_FREQUENCY };</div>
<div class="line"> </div>
<div class="line">    rslt = <a class="code hl_function" href="group__group__hal__i2c.html#gac2885a21905af9d1d48aae34a6032a61">cyhal_i2c_init</a>(&amp;i2c_master_obj, CYBSP_I2C_SDA, CYBSP_I2C_SCL, NULL);</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">if</span> (<a class="code hl_define" href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a> == rslt)</div>
<div class="line">    {</div>
<div class="line">        rslt = <a class="code hl_function" href="group__group__hal__i2c.html#ga37a35abcb9bf2d0ecf2a52b2fa5bce64">cyhal_i2c_configure</a>(&amp;i2c_master_obj, &amp;i2c_master_config);</div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">if</span> (<a class="code hl_define" href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a> == rslt)</div>
<div class="line">    {</div>
<div class="line">        <a class="code hl_function" href="group__group__hal__i2c.html#gacf738716af52c484873e35331b9a30b7">cyhal_i2c_register_callback</a>(&amp;i2c_master_obj,</div>
<div class="line">                                    (<a class="code hl_typedef" href="group__group__hal__i2c.html#ga67df812388aae9fcc3b3b1986dab7a09">cyhal_i2c_event_callback_t</a>)master_event_handler,</div>
<div class="line">                                    NULL);</div>
<div class="line">        <a class="code hl_function" href="group__group__hal__i2c.html#ga6216658331d13dd8a854a23e96141fc7">cyhal_i2c_enable_event</a>(&amp;i2c_master_obj, (<a class="code hl_enumeration" href="group__group__hal__i2c.html#gaaba7daccaa3861c32a4b0284e8194a79">cyhal_i2c_event_t</a>)   \</div>
<div class="line">                               (<a class="code hl_enumvalue" href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79a0365270204869bfe80a2015258c979e1">CYHAL_I2C_MASTER_WR_CMPLT_EVENT</a> \</div>
<div class="line">                                | <a class="code hl_enumvalue" href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79ac5b8050af1c08b0d00a21539c5286435">CYHAL_I2C_MASTER_RD_CMPLT_EVENT</a> \</div>
<div class="line">                                | <a class="code hl_enumvalue" href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79a4bda40d48c2d7ca1c7556367b532920f">CYHAL_I2C_MASTER_ERR_EVENT</a>),    \</div>
<div class="line">                               3u, <span class="keyword">true</span>);</div>
<div class="line"> </div>
<div class="line">        <span class="comment">// Initiate master write and read transfer using tx_buff and rx_buff respectively.</span></div>
<div class="line">        rslt = <a class="code hl_function" href="group__group__hal__i2c.html#gad6cd59cead5f7de0cf87571ceb656054">cyhal_i2c_master_transfer_async</a>(&amp;i2c_master_obj, I2C_SLAVE_ADDRESS, tx_buff, 3,</div>
<div class="line">                                               rx_buff, 3);</div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">return</span> rslt;</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="ttc" id="agroup__group__hal__i2c_html_ga5ee41d9e5c6dc83376291ff5275c942a"><div class="ttname"><a href="group__group__hal__i2c.html#ga5ee41d9e5c6dc83376291ff5275c942a">cyhal_i2c_abort_async</a></div><div class="ttdeci">cy_rslt_t cyhal_i2c_abort_async(cyhal_i2c_t *obj)</div><div class="ttdoc">Abort asynchronous transfer.</div></div>
<div class="ttc" id="agroup__group__hal__i2c_html_gad6cd59cead5f7de0cf87571ceb656054"><div class="ttname"><a href="group__group__hal__i2c.html#gad6cd59cead5f7de0cf87571ceb656054">cyhal_i2c_master_transfer_async</a></div><div class="ttdeci">cy_rslt_t cyhal_i2c_master_transfer_async(cyhal_i2c_t *obj, uint16_t address, const void *tx, size_t tx_size, void *rx, size_t rx_size)</div><div class="ttdoc">Initiate a non-blocking I2C master asynchronous transfer.</div></div>
<div class="ttc" id="agroup__group__hal__i2c_html_ggaaba7daccaa3861c32a4b0284e8194a79a0365270204869bfe80a2015258c979e1"><div class="ttname"><a href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79a0365270204869bfe80a2015258c979e1">CYHAL_I2C_MASTER_WR_CMPLT_EVENT</a></div><div class="ttdeci">@ CYHAL_I2C_MASTER_WR_CMPLT_EVENT</div><div class="ttdoc">The master write started by cyhal_i2c_master_transfer_async is complete.</div><div class="ttdef"><b>Definition:</b> cyhal_i2c.h:179</div></div>
<div class="ttc" id="agroup__group__hal__i2c_html_ggaaba7daccaa3861c32a4b0284e8194a79a4bda40d48c2d7ca1c7556367b532920f"><div class="ttname"><a href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79a4bda40d48c2d7ca1c7556367b532920f">CYHAL_I2C_MASTER_ERR_EVENT</a></div><div class="ttdeci">@ CYHAL_I2C_MASTER_ERR_EVENT</div><div class="ttdoc">Indicates the I2C hardware has detected an error.</div><div class="ttdef"><b>Definition:</b> cyhal_i2c.h:181</div></div>
<div class="ttc" id="agroup__group__hal__i2c_html_ggaaba7daccaa3861c32a4b0284e8194a79ac5b8050af1c08b0d00a21539c5286435"><div class="ttname"><a href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79ac5b8050af1c08b0d00a21539c5286435">CYHAL_I2C_MASTER_RD_CMPLT_EVENT</a></div><div class="ttdeci">@ CYHAL_I2C_MASTER_RD_CMPLT_EVENT</div><div class="ttdoc">The master read started by cyhal_i2c_master_transfer_async is complete.</div><div class="ttdef"><b>Definition:</b> cyhal_i2c.h:180</div></div>
</div><!-- fragment --><h1><a class="anchor" id="subsection_i2c_moreinformation"></a>
More Information</h1>
<p ><b>Peripheral Driver Library (PDL)</b></p><ul>
<li><a href="https://infineon.github.io/psoc6pdl/pdl_api_reference_manual/html/group__group__scb.html"><b> PSoC™ 6 PDL: SCB (Serial Communication Block)</b></a></li>
</ul>
<p ><b>Code examples (Github)</b></p><ul>
<li><a href="https://github.com/infineon/mtb-example-psoc6-i2c-master"><b> PSoC™ 6 MCU: I2C Master</b></a></li>
<li><a href="https://github.com/infineon/mtb-example-psoc6-i2c-slave-callback"><b> PSoC™ 6 MCU: I2C Slave Using Callbacks</b></a> </li>
</ul>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="groups" name="groups"></a>
API Reference</h2></td></tr>
<tr class="memitem:group__group__hal__results__i2c"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__results__i2c.html">I2C HAL Results</a></td></tr>
<tr class="memdesc:group__group__hal__results__i2c"><td class="mdescLeft">&#160;</td><td class="mdescRight">I2C specific return codes. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:structcyhal__i2c__cfg__t"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#structcyhal__i2c__cfg__t">cyhal_i2c_cfg_t</a></td></tr>
<tr class="memdesc:structcyhal__i2c__cfg__t"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initial I2C configuration.  <a href="group__group__hal__i2c.html#structcyhal__i2c__cfg__t">More...</a><br /></td></tr>
<tr class="separator:structcyhal__i2c__cfg__t"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:structcyhal__i2c__adv__cfg__t"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#structcyhal__i2c__adv__cfg__t">cyhal_i2c_adv_cfg_t</a></td></tr>
<tr class="memdesc:structcyhal__i2c__adv__cfg__t"><td class="mdescLeft">&#160;</td><td class="mdescRight">I2C advanced configuration.  <a href="group__group__hal__i2c.html#structcyhal__i2c__adv__cfg__t">More...</a><br /></td></tr>
<tr class="separator:structcyhal__i2c__adv__cfg__t"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:gad2ea1e12f91892dfd0d6695b11f1d4a5"><td class="memItemLeft" align="right" valign="top"><a id="gad2ea1e12f91892dfd0d6695b11f1d4a5" name="gad2ea1e12f91892dfd0d6695b11f1d4a5"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>CYHAL_I2C_MODE_SLAVE</b>&#160;&#160;&#160;(true)</td></tr>
<tr class="memdesc:gad2ea1e12f91892dfd0d6695b11f1d4a5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Named define for Slave mode for use when initializing the <a class="el" href="group__group__hal__i2c.html#structcyhal__i2c__cfg__t">cyhal_i2c_cfg_t</a> structure. <br /></td></tr>
<tr class="separator:gad2ea1e12f91892dfd0d6695b11f1d4a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae8ce31deae8ac6078af98b52249e0089"><td class="memItemLeft" align="right" valign="top"><a id="gae8ce31deae8ac6078af98b52249e0089" name="gae8ce31deae8ac6078af98b52249e0089"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>CYHAL_I2C_MODE_MASTER</b>&#160;&#160;&#160;(false)</td></tr>
<tr class="memdesc:gae8ce31deae8ac6078af98b52249e0089"><td class="mdescLeft">&#160;</td><td class="mdescRight">Named define for Master mode for use when initializing the <a class="el" href="group__group__hal__i2c.html#structcyhal__i2c__cfg__t">cyhal_i2c_cfg_t</a> structure. <br /></td></tr>
<tr class="separator:gae8ce31deae8ac6078af98b52249e0089"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf769c5b0458ce47e452cf14227add3a0"><td class="memItemLeft" align="right" valign="top"><a id="gaf769c5b0458ce47e452cf14227add3a0" name="gaf769c5b0458ce47e452cf14227add3a0"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>CYHAL_I2C_DEFAULT_ADDR_MASK</b>&#160;&#160;&#160;(0xFE)</td></tr>
<tr class="memdesc:gaf769c5b0458ce47e452cf14227add3a0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Named define for default address mask for use when initializing the <a class="el" href="group__group__hal__i2c.html#structcyhal__i2c__adv__cfg__t">cyhal_i2c_adv_cfg_t</a> structure. <br /></td></tr>
<tr class="separator:gaf769c5b0458ce47e452cf14227add3a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga67df812388aae9fcc3b3b1986dab7a09"><td class="memItemLeft" align="right" valign="top"><a id="ga67df812388aae9fcc3b3b1986dab7a09" name="ga67df812388aae9fcc3b3b1986dab7a09"></a>
typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><b>cyhal_i2c_event_callback_t</b>) (void *callback_arg, <a class="el" href="group__group__hal__i2c.html#gaaba7daccaa3861c32a4b0284e8194a79">cyhal_i2c_event_t</a> event)</td></tr>
<tr class="memdesc:ga67df812388aae9fcc3b3b1986dab7a09"><td class="mdescLeft">&#160;</td><td class="mdescRight">Handler for I2C events. <br /></td></tr>
<tr class="separator:ga67df812388aae9fcc3b3b1986dab7a09"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf1b10084a21b85fbc040238f0c205782"><td class="memItemLeft" align="right" valign="top"><a id="gaf1b10084a21b85fbc040238f0c205782" name="gaf1b10084a21b85fbc040238f0c205782"></a>
typedef <a class="el" href="group__group__hal__i2c.html#gab8cea7222ae651a94ac82b9ed74e6458">cyhal_i2c_command_rsp_t</a>(*&#160;</td><td class="memItemRight" valign="bottom"><b>cyhal_i2c_address_callback_t</b>) (void *callback_arg, <a class="el" href="group__group__hal__i2c.html#ga10f472dd5ea523332e85610d903a020c">cyhal_i2c_addr_event_t</a> event, uint8_t address)</td></tr>
<tr class="memdesc:gaf1b10084a21b85fbc040238f0c205782"><td class="mdescLeft">&#160;</td><td class="mdescRight">Handler for I2C address events. <br /></td></tr>
<tr class="separator:gaf1b10084a21b85fbc040238f0c205782"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="enum-members" name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:gaaba7daccaa3861c32a4b0284e8194a79"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#gaaba7daccaa3861c32a4b0284e8194a79">cyhal_i2c_event_t</a> { <br />
&#160;&#160;<a class="el" href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79a80d8eb3997f062277769a958ff0b74bd">CYHAL_I2C_EVENT_NONE</a> = 0
, <br />
&#160;&#160;<a class="el" href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79a08f85e87b6ee6690714adc58a8b4a426">CYHAL_I2C_SLAVE_READ_EVENT</a> = 1 &lt;&lt; 1
, <br />
&#160;&#160;<a class="el" href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79af9d18fd8a6768ca60dbc475d3a08f13a">CYHAL_I2C_SLAVE_WRITE_EVENT</a> = 1 &lt;&lt; 2
, <br />
&#160;&#160;<a class="el" href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79ad4a472c6da6121e533e871960a57d8b3">CYHAL_I2C_SLAVE_RD_IN_FIFO_EVENT</a> = 1 &lt;&lt; 3
, <br />
&#160;&#160;<a class="el" href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79af1d3cec9a44b25d6d1434b9d21457cf2">CYHAL_I2C_SLAVE_RD_BUF_EMPTY_EVENT</a> = 1 &lt;&lt; 4
, <br />
&#160;&#160;<a class="el" href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79af3743e0bae6fc016ae15741d69b765e8">CYHAL_I2C_SLAVE_RD_CMPLT_EVENT</a> = 1 &lt;&lt; 5
, <br />
&#160;&#160;<a class="el" href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79aed43708fe51a3270699f80f21dde4bac">CYHAL_I2C_SLAVE_WR_CMPLT_EVENT</a> = 1 &lt;&lt; 6
, <br />
&#160;&#160;<a class="el" href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79aba7cb8e07c8f47bd41a74af1373c7d04">CYHAL_I2C_SLAVE_ERR_EVENT</a> = 1 &lt;&lt; 7
, <br />
&#160;&#160;<a class="el" href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79a9fd6214feece0581282414f326fc3ef4">CYHAL_I2C_MASTER_WR_IN_FIFO_EVENT</a> = 1 &lt;&lt; 17
, <br />
&#160;&#160;<a class="el" href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79a0365270204869bfe80a2015258c979e1">CYHAL_I2C_MASTER_WR_CMPLT_EVENT</a> = 1 &lt;&lt; 18
, <br />
&#160;&#160;<a class="el" href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79ac5b8050af1c08b0d00a21539c5286435">CYHAL_I2C_MASTER_RD_CMPLT_EVENT</a> = 1 &lt;&lt; 19
, <br />
&#160;&#160;<a class="el" href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79a4bda40d48c2d7ca1c7556367b532920f">CYHAL_I2C_MASTER_ERR_EVENT</a> = 1 &lt;&lt; 20
<br />
 }</td></tr>
<tr class="memdesc:gaaba7daccaa3861c32a4b0284e8194a79"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enum to enable/disable/report interrupt cause flags.  <a href="group__group__hal__i2c.html#gaaba7daccaa3861c32a4b0284e8194a79">More...</a><br /></td></tr>
<tr class="separator:gaaba7daccaa3861c32a4b0284e8194a79"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga10f472dd5ea523332e85610d903a020c"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#ga10f472dd5ea523332e85610d903a020c">cyhal_i2c_addr_event_t</a> { <br />
&#160;&#160;<a class="el" href="group__group__hal__i2c.html#gga10f472dd5ea523332e85610d903a020caa73336b121c90993dc7a6863b8c4aa61">CYHAL_I2C_ADDR_EVENT_NONE</a> = 0
, <br />
&#160;&#160;<a class="el" href="group__group__hal__i2c.html#gga10f472dd5ea523332e85610d903a020ca41f1138ead03bf6036d4c6619fd3cced">CYHAL_I2C_GENERAL_CALL_EVENT</a> = 1 &lt;&lt; 1
, <br />
&#160;&#160;<a class="el" href="group__group__hal__i2c.html#gga10f472dd5ea523332e85610d903a020ca6375d0f8ef5d6bf5ed82ad519db8b8a7">CYHAL_I2C_ADDR_MATCH_EVENT</a> = 1 &lt;&lt; 2
<br />
 }</td></tr>
<tr class="memdesc:ga10f472dd5ea523332e85610d903a020c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enum to enable/disable/report address interrupt cause flags.  <a href="group__group__hal__i2c.html#ga10f472dd5ea523332e85610d903a020c">More...</a><br /></td></tr>
<tr class="separator:ga10f472dd5ea523332e85610d903a020c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa59a59acf36a7815929230f07ea3f8e9"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#gaa59a59acf36a7815929230f07ea3f8e9">cyhal_i2c_fifo_type_t</a> { <br />
&#160;&#160;<a class="el" href="group__group__hal__i2c.html#ggaa59a59acf36a7815929230f07ea3f8e9ab0def432120ebd7d53251a7ca0538c60">CYHAL_I2C_FIFO_RX</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__i2c.html#ggaa59a59acf36a7815929230f07ea3f8e9a7b975cb6cde74026ffc091a52a32cf42">CYHAL_I2C_FIFO_TX</a>
<br />
 }</td></tr>
<tr class="memdesc:gaa59a59acf36a7815929230f07ea3f8e9"><td class="mdescLeft">&#160;</td><td class="mdescRight">I2C FIFO type.  <a href="group__group__hal__i2c.html#gaa59a59acf36a7815929230f07ea3f8e9">More...</a><br /></td></tr>
<tr class="separator:gaa59a59acf36a7815929230f07ea3f8e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab8cea7222ae651a94ac82b9ed74e6458"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#gab8cea7222ae651a94ac82b9ed74e6458">cyhal_i2c_command_rsp_t</a> { <br />
&#160;&#160;<a class="el" href="group__group__hal__i2c.html#ggab8cea7222ae651a94ac82b9ed74e6458a6be97c5798dd2d782492c37e1eeb9db3">CYHAL_I2C_CMD_ACK</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__i2c.html#ggab8cea7222ae651a94ac82b9ed74e6458a8d9e6403c212ac1c8ea20aac70de3a06">CYHAL_I2C_CMD_NAK</a>
<br />
 }</td></tr>
<tr class="memdesc:gab8cea7222ae651a94ac82b9ed74e6458"><td class="mdescLeft">&#160;</td><td class="mdescRight">I2C Command ACK / NAK.  <a href="group__group__hal__i2c.html#gab8cea7222ae651a94ac82b9ed74e6458">More...</a><br /></td></tr>
<tr class="separator:gab8cea7222ae651a94ac82b9ed74e6458"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga67be23b92e99d5314fe8158d8ea51611"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#ga67be23b92e99d5314fe8158d8ea51611">cyhal_i2c_output_t</a> { <br />
&#160;&#160;<a class="el" href="group__group__hal__i2c.html#gga67be23b92e99d5314fe8158d8ea51611a15a22f5be41fbbe6ca9fb9a59aeb7bd5">CYHAL_I2C_OUTPUT_TRIGGER_RX_FIFO_LEVEL_REACHED</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__i2c.html#gga67be23b92e99d5314fe8158d8ea51611a1c425697142c9aad19da2114788bbf08">CYHAL_I2C_OUTPUT_TRIGGER_TX_FIFO_LEVEL_REACHED</a>
<br />
 }</td></tr>
<tr class="memdesc:ga67be23b92e99d5314fe8158d8ea51611"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enum of possible output signals from an I2C.  <a href="group__group__hal__i2c.html#ga67be23b92e99d5314fe8158d8ea51611">More...</a><br /></td></tr>
<tr class="separator:ga67be23b92e99d5314fe8158d8ea51611"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gac2885a21905af9d1d48aae34a6032a61"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#gac2885a21905af9d1d48aae34a6032a61">cyhal_i2c_init</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *obj, <a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a> sda, <a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a> scl, const <a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__clock__t">cyhal_clock_t</a> *clk)</td></tr>
<tr class="memdesc:gac2885a21905af9d1d48aae34a6032a61"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the I2C peripheral, and configures its specified pins.  <a href="group__group__hal__i2c.html#gac2885a21905af9d1d48aae34a6032a61">More...</a><br /></td></tr>
<tr class="separator:gac2885a21905af9d1d48aae34a6032a61"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3335fac7601fb3a6e4210d24e55cca61"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#ga3335fac7601fb3a6e4210d24e55cca61">cyhal_i2c_free</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *obj)</td></tr>
<tr class="memdesc:ga3335fac7601fb3a6e4210d24e55cca61"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deinitialize the i2c object.  <a href="group__group__hal__i2c.html#ga3335fac7601fb3a6e4210d24e55cca61">More...</a><br /></td></tr>
<tr class="separator:ga3335fac7601fb3a6e4210d24e55cca61"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga37a35abcb9bf2d0ecf2a52b2fa5bce64"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#ga37a35abcb9bf2d0ecf2a52b2fa5bce64">cyhal_i2c_configure</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *obj, const <a class="el" href="group__group__hal__i2c.html#structcyhal__i2c__cfg__t">cyhal_i2c_cfg_t</a> *cfg)</td></tr>
<tr class="memdesc:ga37a35abcb9bf2d0ecf2a52b2fa5bce64"><td class="mdescLeft">&#160;</td><td class="mdescRight">Configure the I2C block.  <a href="group__group__hal__i2c.html#ga37a35abcb9bf2d0ecf2a52b2fa5bce64">More...</a><br /></td></tr>
<tr class="separator:ga37a35abcb9bf2d0ecf2a52b2fa5bce64"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga374725474725fa84841feedf11eb5359"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#ga374725474725fa84841feedf11eb5359">cyhal_i2c_configure_adv</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *obj, const <a class="el" href="group__group__hal__i2c.html#structcyhal__i2c__adv__cfg__t">cyhal_i2c_adv_cfg_t</a> *cfg)</td></tr>
<tr class="memdesc:ga374725474725fa84841feedf11eb5359"><td class="mdescLeft">&#160;</td><td class="mdescRight">Configure the I2C block with advanced parameters.  <a href="group__group__hal__i2c.html#ga374725474725fa84841feedf11eb5359">More...</a><br /></td></tr>
<tr class="separator:ga374725474725fa84841feedf11eb5359"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf100c21cd95409c70e1ba0463c23e3f8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#gaf100c21cd95409c70e1ba0463c23e3f8">cyhal_i2c_master_write</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *obj, uint16_t dev_addr, const uint8_t *data, uint16_t size, uint32_t timeout, bool send_stop)</td></tr>
<tr class="memdesc:gaf100c21cd95409c70e1ba0463c23e3f8"><td class="mdescLeft">&#160;</td><td class="mdescRight">I2C master blocking write.  <a href="group__group__hal__i2c.html#gaf100c21cd95409c70e1ba0463c23e3f8">More...</a><br /></td></tr>
<tr class="separator:gaf100c21cd95409c70e1ba0463c23e3f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0652a883293c83ebd0612fddbd8ff64d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#ga0652a883293c83ebd0612fddbd8ff64d">cyhal_i2c_master_read</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *obj, uint16_t dev_addr, uint8_t *data, uint16_t size, uint32_t timeout, bool send_stop)</td></tr>
<tr class="memdesc:ga0652a883293c83ebd0612fddbd8ff64d"><td class="mdescLeft">&#160;</td><td class="mdescRight">I2C master blocking read.  <a href="group__group__hal__i2c.html#ga0652a883293c83ebd0612fddbd8ff64d">More...</a><br /></td></tr>
<tr class="separator:ga0652a883293c83ebd0612fddbd8ff64d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2642bdcfecb06786c438801bbc6ed844"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#ga2642bdcfecb06786c438801bbc6ed844">cyhal_i2c_slave_config_write_buffer</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *obj, const uint8_t *data, uint16_t size)</td></tr>
<tr class="memdesc:ga2642bdcfecb06786c438801bbc6ed844"><td class="mdescLeft">&#160;</td><td class="mdescRight">The function configures the write buffer on an I2C Slave.  <a href="group__group__hal__i2c.html#ga2642bdcfecb06786c438801bbc6ed844">More...</a><br /></td></tr>
<tr class="separator:ga2642bdcfecb06786c438801bbc6ed844"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1f1570c650c1ddd12a8ffb6081dd56bb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#ga1f1570c650c1ddd12a8ffb6081dd56bb">cyhal_i2c_slave_config_read_buffer</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *obj, uint8_t *data, uint16_t size)</td></tr>
<tr class="memdesc:ga1f1570c650c1ddd12a8ffb6081dd56bb"><td class="mdescLeft">&#160;</td><td class="mdescRight">The function configures the read buffer on an I2C Slave.  <a href="group__group__hal__i2c.html#ga1f1570c650c1ddd12a8ffb6081dd56bb">More...</a><br /></td></tr>
<tr class="separator:ga1f1570c650c1ddd12a8ffb6081dd56bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac9d0f4633fe8e121b93540d2415e4dd2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#gac9d0f4633fe8e121b93540d2415e4dd2">cyhal_i2c_master_mem_write</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *obj, uint16_t address, uint16_t mem_addr, uint16_t mem_addr_size, const uint8_t *data, uint16_t size, uint32_t timeout)</td></tr>
<tr class="memdesc:gac9d0f4633fe8e121b93540d2415e4dd2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Perform an I2C write using a block of data stored at the specified memory location.  <a href="group__group__hal__i2c.html#gac9d0f4633fe8e121b93540d2415e4dd2">More...</a><br /></td></tr>
<tr class="separator:gac9d0f4633fe8e121b93540d2415e4dd2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3b3c9ae9cd2a99bfb7fcd513c00a50bd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#ga3b3c9ae9cd2a99bfb7fcd513c00a50bd">cyhal_i2c_master_mem_read</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *obj, uint16_t address, uint16_t mem_addr, uint16_t mem_addr_size, uint8_t *data, uint16_t size, uint32_t timeout)</td></tr>
<tr class="memdesc:ga3b3c9ae9cd2a99bfb7fcd513c00a50bd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Perform an I2C read using a block of data stored at the specified memory location.  <a href="group__group__hal__i2c.html#ga3b3c9ae9cd2a99bfb7fcd513c00a50bd">More...</a><br /></td></tr>
<tr class="separator:ga3b3c9ae9cd2a99bfb7fcd513c00a50bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad6cd59cead5f7de0cf87571ceb656054"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#gad6cd59cead5f7de0cf87571ceb656054">cyhal_i2c_master_transfer_async</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *obj, uint16_t address, const void *tx, size_t tx_size, void *rx, size_t rx_size)</td></tr>
<tr class="memdesc:gad6cd59cead5f7de0cf87571ceb656054"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initiate a non-blocking I2C master asynchronous transfer.  <a href="group__group__hal__i2c.html#gad6cd59cead5f7de0cf87571ceb656054">More...</a><br /></td></tr>
<tr class="separator:gad6cd59cead5f7de0cf87571ceb656054"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5ee41d9e5c6dc83376291ff5275c942a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#ga5ee41d9e5c6dc83376291ff5275c942a">cyhal_i2c_abort_async</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *obj)</td></tr>
<tr class="memdesc:ga5ee41d9e5c6dc83376291ff5275c942a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Abort asynchronous transfer.  <a href="group__group__hal__i2c.html#ga5ee41d9e5c6dc83376291ff5275c942a">More...</a><br /></td></tr>
<tr class="separator:ga5ee41d9e5c6dc83376291ff5275c942a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacf738716af52c484873e35331b9a30b7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#gacf738716af52c484873e35331b9a30b7">cyhal_i2c_register_callback</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *obj, <a class="el" href="group__group__hal__i2c.html#ga67df812388aae9fcc3b3b1986dab7a09">cyhal_i2c_event_callback_t</a> callback, void *callback_arg)</td></tr>
<tr class="memdesc:gacf738716af52c484873e35331b9a30b7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register an I2C event callback handler<br  />
  <a href="group__group__hal__i2c.html#gacf738716af52c484873e35331b9a30b7">More...</a><br /></td></tr>
<tr class="separator:gacf738716af52c484873e35331b9a30b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaafc998a7480459a782345d4c20317072"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#gaafc998a7480459a782345d4c20317072">cyhal_i2c_register_address_callback</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *obj, <a class="el" href="group__group__hal__i2c.html#gaf1b10084a21b85fbc040238f0c205782">cyhal_i2c_address_callback_t</a> callback, void *callback_arg)</td></tr>
<tr class="memdesc:gaafc998a7480459a782345d4c20317072"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register an I2C address callback handler<br  />
  <a href="group__group__hal__i2c.html#gaafc998a7480459a782345d4c20317072">More...</a><br /></td></tr>
<tr class="separator:gaafc998a7480459a782345d4c20317072"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6216658331d13dd8a854a23e96141fc7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#ga6216658331d13dd8a854a23e96141fc7">cyhal_i2c_enable_event</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *obj, <a class="el" href="group__group__hal__i2c.html#gaaba7daccaa3861c32a4b0284e8194a79">cyhal_i2c_event_t</a> event, uint8_t intr_priority, bool enable)</td></tr>
<tr class="memdesc:ga6216658331d13dd8a854a23e96141fc7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Configure and Enable or Disable I2C Interrupt.  <a href="group__group__hal__i2c.html#ga6216658331d13dd8a854a23e96141fc7">More...</a><br /></td></tr>
<tr class="separator:ga6216658331d13dd8a854a23e96141fc7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga580008770cd8c2dfcc7c919d25ba9904"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#ga580008770cd8c2dfcc7c919d25ba9904">cyhal_i2c_enable_address_event</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *obj, <a class="el" href="group__group__hal__i2c.html#ga10f472dd5ea523332e85610d903a020c">cyhal_i2c_addr_event_t</a> event, uint8_t intr_priority, bool enable)</td></tr>
<tr class="memdesc:ga580008770cd8c2dfcc7c919d25ba9904"><td class="mdescLeft">&#160;</td><td class="mdescRight">Configure and Enable or Disable I2C Address Interrupt.  <a href="group__group__hal__i2c.html#ga580008770cd8c2dfcc7c919d25ba9904">More...</a><br /></td></tr>
<tr class="separator:ga580008770cd8c2dfcc7c919d25ba9904"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga28d8b90e912067afa2be1ad63e0e26bf"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#ga28d8b90e912067afa2be1ad63e0e26bf">cyhal_i2c_set_fifo_level</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *obj, <a class="el" href="group__group__hal__i2c.html#gaa59a59acf36a7815929230f07ea3f8e9">cyhal_i2c_fifo_type_t</a> type, uint16_t level)</td></tr>
<tr class="memdesc:ga28d8b90e912067afa2be1ad63e0e26bf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets a threshold level for a FIFO that will generate an interrupt and a trigger output.  <a href="group__group__hal__i2c.html#ga28d8b90e912067afa2be1ad63e0e26bf">More...</a><br /></td></tr>
<tr class="separator:ga28d8b90e912067afa2be1ad63e0e26bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf2012311623f37e679e8af020481429a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#gaf2012311623f37e679e8af020481429a">cyhal_i2c_enable_output</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *obj, <a class="el" href="group__group__hal__i2c.html#ga67be23b92e99d5314fe8158d8ea51611">cyhal_i2c_output_t</a> output, <a class="el" href="group__group__hal__impl__triggers__psoc6__01.html#ga96236d1368f920d28af90262e8b57046">cyhal_source_t</a> *source)</td></tr>
<tr class="memdesc:gaf2012311623f37e679e8af020481429a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables the specified output signal from an I2C.  <a href="group__group__hal__i2c.html#gaf2012311623f37e679e8af020481429a">More...</a><br /></td></tr>
<tr class="separator:gaf2012311623f37e679e8af020481429a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf1b47ca281e0d070cd62b7ad1ba6a576"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#gaf1b47ca281e0d070cd62b7ad1ba6a576">cyhal_i2c_disable_output</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *obj, <a class="el" href="group__group__hal__i2c.html#ga67be23b92e99d5314fe8158d8ea51611">cyhal_i2c_output_t</a> output)</td></tr>
<tr class="memdesc:gaf1b47ca281e0d070cd62b7ad1ba6a576"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disables the specified output signal from an I2C.  <a href="group__group__hal__i2c.html#gaf1b47ca281e0d070cd62b7ad1ba6a576">More...</a><br /></td></tr>
<tr class="separator:gaf1b47ca281e0d070cd62b7ad1ba6a576"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga947fbdc21502765223abd57241354103"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#ga947fbdc21502765223abd57241354103">cyhal_i2c_init_cfg</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *obj, const <a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__configurator__t">cyhal_i2c_configurator_t</a> *cfg)</td></tr>
<tr class="memdesc:ga947fbdc21502765223abd57241354103"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the I2C peripheral using a configurator generated configuration struct.  <a href="group__group__hal__i2c.html#ga947fbdc21502765223abd57241354103">More...</a><br /></td></tr>
<tr class="separator:ga947fbdc21502765223abd57241354103"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaecffe10cd89c910f06aa321a05c8e07a"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#gaecffe10cd89c910f06aa321a05c8e07a">cyhal_i2c_slave_readable</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *obj)</td></tr>
<tr class="memdesc:gaecffe10cd89c910f06aa321a05c8e07a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of bytes written by the I2C master.  <a href="group__group__hal__i2c.html#gaecffe10cd89c910f06aa321a05c8e07a">More...</a><br /></td></tr>
<tr class="separator:gaecffe10cd89c910f06aa321a05c8e07a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad1bb4fe709608bf15b67c36a89f512d1"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#gad1bb4fe709608bf15b67c36a89f512d1">cyhal_i2c_slave_writable</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *obj)</td></tr>
<tr class="memdesc:gad1bb4fe709608bf15b67c36a89f512d1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of bytes can be read by the I2C master.  <a href="group__group__hal__i2c.html#gad1bb4fe709608bf15b67c36a89f512d1">More...</a><br /></td></tr>
<tr class="separator:gad1bb4fe709608bf15b67c36a89f512d1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1e8bbbd32b1a1ef83dcaa3b3384ef59a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#ga1e8bbbd32b1a1ef83dcaa3b3384ef59a">cyhal_i2c_slave_read</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *obj, uint8_t *dst_buff, uint16_t *size, uint32_t timeout)</td></tr>
<tr class="memdesc:ga1e8bbbd32b1a1ef83dcaa3b3384ef59a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wait for master send data to RX buffer and store them to the user-defined buffer.  <a href="group__group__hal__i2c.html#ga1e8bbbd32b1a1ef83dcaa3b3384ef59a">More...</a><br /></td></tr>
<tr class="separator:ga1e8bbbd32b1a1ef83dcaa3b3384ef59a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaed1d72355cabfdc91285192931e99a95"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#gaed1d72355cabfdc91285192931e99a95">cyhal_i2c_slave_write</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *obj, const uint8_t *src_buff, uint16_t *size, uint32_t timeout)</td></tr>
<tr class="memdesc:gaed1d72355cabfdc91285192931e99a95"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write data from the user-defined buffer to I2C TX buffer.  <a href="group__group__hal__i2c.html#gaed1d72355cabfdc91285192931e99a95">More...</a><br /></td></tr>
<tr class="separator:gaed1d72355cabfdc91285192931e99a95"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1a2d189b083ad0f59d106a60ac99b632"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#ga1a2d189b083ad0f59d106a60ac99b632">cyhal_i2c_slave_abort_read</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *obj)</td></tr>
<tr class="memdesc:ga1a2d189b083ad0f59d106a60ac99b632"><td class="mdescLeft">&#160;</td><td class="mdescRight">The function aborts the configured slave read buffer to be read by the master.  <a href="group__group__hal__i2c.html#ga1a2d189b083ad0f59d106a60ac99b632">More...</a><br /></td></tr>
<tr class="separator:ga1a2d189b083ad0f59d106a60ac99b632"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga779f80bdb9befe92968ecfaf6edbdca9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__i2c.html#ga779f80bdb9befe92968ecfaf6edbdca9">cyhal_i2c_clear</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *obj)</td></tr>
<tr class="memdesc:ga779f80bdb9befe92968ecfaf6edbdca9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clear the I2C buffers.  <a href="group__group__hal__i2c.html#ga779f80bdb9befe92968ecfaf6edbdca9">More...</a><br /></td></tr>
<tr class="separator:ga779f80bdb9befe92968ecfaf6edbdca9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<hr/><h2 class="groupheader">Data Structure Documentation</h2>
<a name="structcyhal__i2c__cfg__t" id="structcyhal__i2c__cfg__t"></a>
<h2 class="memtitle"><span class="permalink"><a href="#structcyhal__i2c__cfg__t">&#9670;&nbsp;</a></span>cyhal_i2c_cfg_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct cyhal_i2c_cfg_t</td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a id="a734b40ed68843e48a0b2586e3fb58fcb" name="a734b40ed68843e48a0b2586e3fb58fcb"></a>bool</td>
<td class="fieldname">
is_slave</td>
<td class="fielddoc">
Operates as a slave when set to (<b>true</b>), else as a master (<b>false</b>) </td></tr>
<tr><td class="fieldtype">
<a id="a7789fe25fd94e1ba74c7312f85fdb4cd" name="a7789fe25fd94e1ba74c7312f85fdb4cd"></a>uint16_t</td>
<td class="fieldname">
address</td>
<td class="fielddoc">
Address of this slave resource (7-bit), should be set to 0 for master. </td></tr>
<tr><td class="fieldtype">
<a id="a4bc56f48688bf67f70d721fd7d94c16a" name="a4bc56f48688bf67f70d721fd7d94c16a"></a>uint32_t</td>
<td class="fieldname">
frequencyhal_hz</td>
<td class="fielddoc">
Frequency that the I2C bus runs at (I2C data rate in bits per second) <br  />
 Refer to the device datasheet for the supported I2C data rates. </td></tr>
</table>

</div>
</div>
<a name="structcyhal__i2c__adv__cfg__t" id="structcyhal__i2c__adv__cfg__t"></a>
<h2 class="memtitle"><span class="permalink"><a href="#structcyhal__i2c__adv__cfg__t">&#9670;&nbsp;</a></span>cyhal_i2c_adv_cfg_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">struct cyhal_i2c_adv_cfg_t</td>
        </tr>
      </table>
</div><div class="memdoc">
<table class="fieldtable">
<tr><th colspan="3">Data Fields</th></tr>
<tr><td class="fieldtype">
<a id="ab3290834f738dd2a722f0729fe1affd6" name="ab3290834f738dd2a722f0729fe1affd6"></a><a class="el" href="group__group__hal__i2c.html#structcyhal__i2c__cfg__t">cyhal_i2c_cfg_t</a></td>
<td class="fieldname">
basic_cfg</td>
<td class="fielddoc">
Basic I2C configuration. </td></tr>
<tr><td class="fieldtype">
<a id="a2a7a8efe34842fec6d0649b60864650a" name="a2a7a8efe34842fec6d0649b60864650a"></a>uint8_t</td>
<td class="fieldname">
address_mask</td>
<td class="fielddoc">
Mask of the slave resource. <p >Not applicable for the master. </p>
</td></tr>
<tr><td class="fieldtype">
<a id="aec6292124987ba94ea0b4412fd8f9d48" name="aec6292124987ba94ea0b4412fd8f9d48"></a>bool</td>
<td class="fieldname">
enable_address_callback</td>
<td class="fielddoc">
Indicates address callback feature is enabled or disable. <p >When it's true the address callback will be invoked. </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="gaaba7daccaa3861c32a4b0284e8194a79" name="gaaba7daccaa3861c32a4b0284e8194a79"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaaba7daccaa3861c32a4b0284e8194a79">&#9670;&nbsp;</a></span>cyhal_i2c_event_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__group__hal__i2c.html#gaaba7daccaa3861c32a4b0284e8194a79">cyhal_i2c_event_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enum to enable/disable/report interrupt cause flags. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggaaba7daccaa3861c32a4b0284e8194a79a80d8eb3997f062277769a958ff0b74bd" name="ggaaba7daccaa3861c32a4b0284e8194a79a80d8eb3997f062277769a958ff0b74bd"></a>CYHAL_I2C_EVENT_NONE&#160;</td><td class="fielddoc"><p >No event. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaaba7daccaa3861c32a4b0284e8194a79a08f85e87b6ee6690714adc58a8b4a426" name="ggaaba7daccaa3861c32a4b0284e8194a79a08f85e87b6ee6690714adc58a8b4a426"></a>CYHAL_I2C_SLAVE_READ_EVENT&#160;</td><td class="fielddoc"><p >Indicates that the slave was addressed and the master wants to read data. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaaba7daccaa3861c32a4b0284e8194a79af9d18fd8a6768ca60dbc475d3a08f13a" name="ggaaba7daccaa3861c32a4b0284e8194a79af9d18fd8a6768ca60dbc475d3a08f13a"></a>CYHAL_I2C_SLAVE_WRITE_EVENT&#160;</td><td class="fielddoc"><p >Indicates that the slave was addressed and the master wants to write data. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaaba7daccaa3861c32a4b0284e8194a79ad4a472c6da6121e533e871960a57d8b3" name="ggaaba7daccaa3861c32a4b0284e8194a79ad4a472c6da6121e533e871960a57d8b3"></a>CYHAL_I2C_SLAVE_RD_IN_FIFO_EVENT&#160;</td><td class="fielddoc"><p >All slave data from the configured Read buffer has been loaded into the TX FIFO. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaaba7daccaa3861c32a4b0284e8194a79af1d3cec9a44b25d6d1434b9d21457cf2" name="ggaaba7daccaa3861c32a4b0284e8194a79af1d3cec9a44b25d6d1434b9d21457cf2"></a>CYHAL_I2C_SLAVE_RD_BUF_EMPTY_EVENT&#160;</td><td class="fielddoc"><p >The master has read all data out of the configured Read buffer. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaaba7daccaa3861c32a4b0284e8194a79af3743e0bae6fc016ae15741d69b765e8" name="ggaaba7daccaa3861c32a4b0284e8194a79af3743e0bae6fc016ae15741d69b765e8"></a>CYHAL_I2C_SLAVE_RD_CMPLT_EVENT&#160;</td><td class="fielddoc"><p >Indicates the master completed reading from the slave (set by the master NAK or Stop) </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaaba7daccaa3861c32a4b0284e8194a79aed43708fe51a3270699f80f21dde4bac" name="ggaaba7daccaa3861c32a4b0284e8194a79aed43708fe51a3270699f80f21dde4bac"></a>CYHAL_I2C_SLAVE_WR_CMPLT_EVENT&#160;</td><td class="fielddoc"><p >Indicates the master completed writing to the slave (set by the master Stop or Restart) </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaaba7daccaa3861c32a4b0284e8194a79aba7cb8e07c8f47bd41a74af1373c7d04" name="ggaaba7daccaa3861c32a4b0284e8194a79aba7cb8e07c8f47bd41a74af1373c7d04"></a>CYHAL_I2C_SLAVE_ERR_EVENT&#160;</td><td class="fielddoc"><p >Indicates the I2C hardware detected an error. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaaba7daccaa3861c32a4b0284e8194a79a9fd6214feece0581282414f326fc3ef4" name="ggaaba7daccaa3861c32a4b0284e8194a79a9fd6214feece0581282414f326fc3ef4"></a>CYHAL_I2C_MASTER_WR_IN_FIFO_EVENT&#160;</td><td class="fielddoc"><p >All data specified by cyhal_i2c_master_transfer_async has been loaded into the TX FIFO. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaaba7daccaa3861c32a4b0284e8194a79a0365270204869bfe80a2015258c979e1" name="ggaaba7daccaa3861c32a4b0284e8194a79a0365270204869bfe80a2015258c979e1"></a>CYHAL_I2C_MASTER_WR_CMPLT_EVENT&#160;</td><td class="fielddoc"><p >The master write started by cyhal_i2c_master_transfer_async is complete. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaaba7daccaa3861c32a4b0284e8194a79ac5b8050af1c08b0d00a21539c5286435" name="ggaaba7daccaa3861c32a4b0284e8194a79ac5b8050af1c08b0d00a21539c5286435"></a>CYHAL_I2C_MASTER_RD_CMPLT_EVENT&#160;</td><td class="fielddoc"><p >The master read started by cyhal_i2c_master_transfer_async is complete. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaaba7daccaa3861c32a4b0284e8194a79a4bda40d48c2d7ca1c7556367b532920f" name="ggaaba7daccaa3861c32a4b0284e8194a79a4bda40d48c2d7ca1c7556367b532920f"></a>CYHAL_I2C_MASTER_ERR_EVENT&#160;</td><td class="fielddoc"><p >Indicates the I2C hardware has detected an error. </p>
</td></tr>
</table>

</div>
</div>
<a id="ga10f472dd5ea523332e85610d903a020c" name="ga10f472dd5ea523332e85610d903a020c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga10f472dd5ea523332e85610d903a020c">&#9670;&nbsp;</a></span>cyhal_i2c_addr_event_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__group__hal__i2c.html#ga10f472dd5ea523332e85610d903a020c">cyhal_i2c_addr_event_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enum to enable/disable/report address interrupt cause flags. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga10f472dd5ea523332e85610d903a020caa73336b121c90993dc7a6863b8c4aa61" name="gga10f472dd5ea523332e85610d903a020caa73336b121c90993dc7a6863b8c4aa61"></a>CYHAL_I2C_ADDR_EVENT_NONE&#160;</td><td class="fielddoc"><p >No event. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga10f472dd5ea523332e85610d903a020ca41f1138ead03bf6036d4c6619fd3cced" name="gga10f472dd5ea523332e85610d903a020ca41f1138ead03bf6036d4c6619fd3cced"></a>CYHAL_I2C_GENERAL_CALL_EVENT&#160;</td><td class="fielddoc"><p >Indicates the slave was addressed by the general call address. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga10f472dd5ea523332e85610d903a020ca6375d0f8ef5d6bf5ed82ad519db8b8a7" name="gga10f472dd5ea523332e85610d903a020ca6375d0f8ef5d6bf5ed82ad519db8b8a7"></a>CYHAL_I2C_ADDR_MATCH_EVENT&#160;</td><td class="fielddoc"><p >Indicates the slave matching address received. </p>
</td></tr>
</table>

</div>
</div>
<a id="gaa59a59acf36a7815929230f07ea3f8e9" name="gaa59a59acf36a7815929230f07ea3f8e9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaa59a59acf36a7815929230f07ea3f8e9">&#9670;&nbsp;</a></span>cyhal_i2c_fifo_type_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__group__hal__i2c.html#gaa59a59acf36a7815929230f07ea3f8e9">cyhal_i2c_fifo_type_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>I2C FIFO type. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggaa59a59acf36a7815929230f07ea3f8e9ab0def432120ebd7d53251a7ca0538c60" name="ggaa59a59acf36a7815929230f07ea3f8e9ab0def432120ebd7d53251a7ca0538c60"></a>CYHAL_I2C_FIFO_RX&#160;</td><td class="fielddoc"><p >Set RX FIFO level. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggaa59a59acf36a7815929230f07ea3f8e9a7b975cb6cde74026ffc091a52a32cf42" name="ggaa59a59acf36a7815929230f07ea3f8e9a7b975cb6cde74026ffc091a52a32cf42"></a>CYHAL_I2C_FIFO_TX&#160;</td><td class="fielddoc"><p >Set TX FIFO level. </p>
</td></tr>
</table>

</div>
</div>
<a id="gab8cea7222ae651a94ac82b9ed74e6458" name="gab8cea7222ae651a94ac82b9ed74e6458"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab8cea7222ae651a94ac82b9ed74e6458">&#9670;&nbsp;</a></span>cyhal_i2c_command_rsp_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__group__hal__i2c.html#gab8cea7222ae651a94ac82b9ed74e6458">cyhal_i2c_command_rsp_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>I2C Command ACK / NAK. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggab8cea7222ae651a94ac82b9ed74e6458a6be97c5798dd2d782492c37e1eeb9db3" name="ggab8cea7222ae651a94ac82b9ed74e6458a6be97c5798dd2d782492c37e1eeb9db3"></a>CYHAL_I2C_CMD_ACK&#160;</td><td class="fielddoc"><p >Send ACK to current byte. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggab8cea7222ae651a94ac82b9ed74e6458a8d9e6403c212ac1c8ea20aac70de3a06" name="ggab8cea7222ae651a94ac82b9ed74e6458a8d9e6403c212ac1c8ea20aac70de3a06"></a>CYHAL_I2C_CMD_NAK&#160;</td><td class="fielddoc"><p >Send NAK to current byte. </p>
</td></tr>
</table>

</div>
</div>
<a id="ga67be23b92e99d5314fe8158d8ea51611" name="ga67be23b92e99d5314fe8158d8ea51611"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga67be23b92e99d5314fe8158d8ea51611">&#9670;&nbsp;</a></span>cyhal_i2c_output_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__group__hal__i2c.html#ga67be23b92e99d5314fe8158d8ea51611">cyhal_i2c_output_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enum of possible output signals from an I2C. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga67be23b92e99d5314fe8158d8ea51611a15a22f5be41fbbe6ca9fb9a59aeb7bd5" name="gga67be23b92e99d5314fe8158d8ea51611a15a22f5be41fbbe6ca9fb9a59aeb7bd5"></a>CYHAL_I2C_OUTPUT_TRIGGER_RX_FIFO_LEVEL_REACHED&#160;</td><td class="fielddoc"><p >Output the RX FIFO signal which is triggered when the receive FIFO has more entries than the configured level. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga67be23b92e99d5314fe8158d8ea51611a1c425697142c9aad19da2114788bbf08" name="gga67be23b92e99d5314fe8158d8ea51611a1c425697142c9aad19da2114788bbf08"></a>CYHAL_I2C_OUTPUT_TRIGGER_TX_FIFO_LEVEL_REACHED&#160;</td><td class="fielddoc"><p >Output the TX FIFO signal which is triggered when the transmit FIFO has less entries than the configured level. </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="gac2885a21905af9d1d48aae34a6032a61" name="gac2885a21905af9d1d48aae34a6032a61"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac2885a21905af9d1d48aae34a6032a61">&#9670;&nbsp;</a></span>cyhal_i2c_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2c_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a>&#160;</td>
          <td class="paramname"><em>sda</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a>&#160;</td>
          <td class="paramname"><em>scl</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__clock__t">cyhal_clock_t</a> *&#160;</td>
          <td class="paramname"><em>clk</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the I2C peripheral, and configures its specified pins. </p>
<p >By default it is configured as a Master with a bus frequency = CYHAL_I2C_MASTER_DEFAULT_FREQ. Use <a class="el" href="group__group__hal__i2c.html#ga37a35abcb9bf2d0ecf2a52b2fa5bce64">cyhal_i2c_configure()</a> to change the default behavior.<br  />
 NOTE: Master/Slave specific functions only work when the block is configured to be in that mode.<br  />
 See <a class="el" href="group__group__hal__i2c.html#subsection_i2c_snippet_1">Snippet 1: I2C Initialization and Configuration</a></p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">obj</td><td>Pointer to an I2C object. The caller must allocate the memory for this object but the init function will initialize its contents. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">sda</td><td>The sda pin </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">scl</td><td>The scl pin </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">clk</td><td>The clock to use can be shared, if not provided a new clock will be allocated </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the init request </dd></dl>

</div>
</div>
<a id="ga3335fac7601fb3a6e4210d24e55cca61" name="ga3335fac7601fb3a6e4210d24e55cca61"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3335fac7601fb3a6e4210d24e55cca61">&#9670;&nbsp;</a></span>cyhal_i2c_free()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_i2c_free </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Deinitialize the i2c object. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">obj</td><td>The i2c object </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga37a35abcb9bf2d0ecf2a52b2fa5bce64" name="ga37a35abcb9bf2d0ecf2a52b2fa5bce64"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga37a35abcb9bf2d0ecf2a52b2fa5bce64">&#9670;&nbsp;</a></span>cyhal_i2c_configure()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2c_configure </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="group__group__hal__i2c.html#structcyhal__i2c__cfg__t">cyhal_i2c_cfg_t</a> *&#160;</td>
          <td class="paramname"><em>cfg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Configure the I2C block. </p>
<p >NOTE: Master/Slave specific functions only work when the block is configured to be in that mode.<br  />
 See <a class="el" href="group__group__hal__i2c.html#subsection_i2c_snippet_1">Snippet 1: I2C Initialization and Configuration</a></p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2C object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">cfg</td><td>Configuration settings to apply </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the configure request </dd></dl>

</div>
</div>
<a id="ga374725474725fa84841feedf11eb5359" name="ga374725474725fa84841feedf11eb5359"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga374725474725fa84841feedf11eb5359">&#9670;&nbsp;</a></span>cyhal_i2c_configure_adv()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2c_configure_adv </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="group__group__hal__i2c.html#structcyhal__i2c__adv__cfg__t">cyhal_i2c_adv_cfg_t</a> *&#160;</td>
          <td class="paramname"><em>cfg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Configure the I2C block with advanced parameters. </p>
<p >Refer to <a class="el" href="group__group__hal__i2c.html#structcyhal__i2c__adv__cfg__t">cyhal_i2c_adv_cfg_t</a> structure for the description of advanced parameters. NOTE: Master/Slave specific functions only work when the block is configured to be in that mode.<br  />
 See <a class="el" href="group__group__hal__i2c.html#subsection_i2c_snippet_1">Snippet 1: I2C Initialization and Configuration</a></p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2C object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">cfg</td><td>Advanced configuration settings to apply </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the configure request </dd></dl>

</div>
</div>
<a id="gaf100c21cd95409c70e1ba0463c23e3f8" name="gaf100c21cd95409c70e1ba0463c23e3f8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf100c21cd95409c70e1ba0463c23e3f8">&#9670;&nbsp;</a></span>cyhal_i2c_master_write()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2c_master_write </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>dev_addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>timeout</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>send_stop</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>I2C master blocking write. </p>
<p >This will write <code>size</code> bytes of data from the buffer pointed to by <code>data</code>. It will not return until either all of the data has been written, or the timeout has elapsed.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2C object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">dev_addr</td><td>device address (7-bit) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>I2C send data </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>I2C send data size </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">timeout</td><td>timeout in millisecond, set this value to 0 if you want to wait forever </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">send_stop</td><td>whether the stop should be send, used to support repeat start conditions</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the master_write request </dd></dl>

</div>
</div>
<a id="ga0652a883293c83ebd0612fddbd8ff64d" name="ga0652a883293c83ebd0612fddbd8ff64d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0652a883293c83ebd0612fddbd8ff64d">&#9670;&nbsp;</a></span>cyhal_i2c_master_read()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2c_master_read </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>dev_addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>timeout</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>send_stop</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>I2C master blocking read. </p>
<p >This will read <code>size</code> bytes of data into the buffer pointed to by <code>data</code>. It will not return until either all of the data has been read, or the timeout has elapsed.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2C object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">dev_addr</td><td>device address (7-bit) </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">data</td><td>I2C receive data </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>I2C receive data size </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">timeout</td><td>timeout in millisecond, set this value to 0 if you want to wait forever </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">send_stop</td><td>whether the stop should be send, used to support repeat start conditions</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the master_read request </dd></dl>

</div>
</div>
<a id="ga2642bdcfecb06786c438801bbc6ed844" name="ga2642bdcfecb06786c438801bbc6ed844"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2642bdcfecb06786c438801bbc6ed844">&#9670;&nbsp;</a></span>cyhal_i2c_slave_config_write_buffer()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2c_slave_config_write_buffer </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The function configures the write buffer on an I2C Slave. </p>
<p >This is the buffer to which the master writes data to. The user needs to setup a new buffer every time (i.e. call <a class="el" href="group__group__hal__i2c.html#ga2642bdcfecb06786c438801bbc6ed844">cyhal_i2c_slave_config_write_buffer</a> and <a class="el" href="group__group__hal__i2c.html#ga1f1570c650c1ddd12a8ffb6081dd56bb">cyhal_i2c_slave_config_read_buffer</a> every time the buffer has been used up)<br  />
 See related code example: <a href="https://github.com/infineon/mtb-example-psoc6-i2c-master"><b>PSoC™ 6 MCU: I2C Master</b></a></p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2C object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>I2C slave send data </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>I2C slave send data size</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the slave_config_write_buffer request </dd></dl>

</div>
</div>
<a id="ga1f1570c650c1ddd12a8ffb6081dd56bb" name="ga1f1570c650c1ddd12a8ffb6081dd56bb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1f1570c650c1ddd12a8ffb6081dd56bb">&#9670;&nbsp;</a></span>cyhal_i2c_slave_config_read_buffer()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2c_slave_config_read_buffer </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The function configures the read buffer on an I2C Slave. </p>
<p >This is the buffer from which the master reads data from. The user needs to setup a new buffer every time (i.e. call <a class="el" href="group__group__hal__i2c.html#ga2642bdcfecb06786c438801bbc6ed844">cyhal_i2c_slave_config_write_buffer</a> and <a class="el" href="group__group__hal__i2c.html#ga1f1570c650c1ddd12a8ffb6081dd56bb">cyhal_i2c_slave_config_read_buffer</a> every time the buffer has been used up)<br  />
 See related code example: <a href="https://github.com/infineon/mtb-example-psoc6-i2c-master"><b>PSoC™ 6 MCU: I2C Master</b></a></p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2C object </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">data</td><td>I2C slave receive data </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>I2C slave receive data size</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the slave_config_read_buffer request </dd></dl>

</div>
</div>
<a id="gac9d0f4633fe8e121b93540d2415e4dd2" name="gac9d0f4633fe8e121b93540d2415e4dd2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac9d0f4633fe8e121b93540d2415e4dd2">&#9670;&nbsp;</a></span>cyhal_i2c_master_mem_write()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2c_master_mem_write </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>address</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>mem_addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>mem_addr_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>timeout</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Perform an I2C write using a block of data stored at the specified memory location. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2C object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">address</td><td>device address (7-bit) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">mem_addr</td><td>mem address to store the written data </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">mem_addr_size</td><td>number of bytes in the mem address </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>I2C master send data </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>I2C master send data size </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">timeout</td><td>timeout in millisecond, set this value to 0 if you want to wait forever </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the write request </dd></dl>

</div>
</div>
<a id="ga3b3c9ae9cd2a99bfb7fcd513c00a50bd" name="ga3b3c9ae9cd2a99bfb7fcd513c00a50bd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3b3c9ae9cd2a99bfb7fcd513c00a50bd">&#9670;&nbsp;</a></span>cyhal_i2c_master_mem_read()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2c_master_mem_read </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>address</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>mem_addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>mem_addr_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>timeout</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Perform an I2C read using a block of data stored at the specified memory location. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2C object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">address</td><td>device address (7-bit) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">mem_addr</td><td>mem address to read the data from </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">mem_addr_size</td><td>number of bytes in the mem address </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">data</td><td>I2C master receive data </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>I2C master receive data size </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">timeout</td><td>timeout in millisecond, set this value to 0 if you want to wait forever </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the read request </dd></dl>

</div>
</div>
<a id="gad6cd59cead5f7de0cf87571ceb656054" name="gad6cd59cead5f7de0cf87571ceb656054"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad6cd59cead5f7de0cf87571ceb656054">&#9670;&nbsp;</a></span>cyhal_i2c_master_transfer_async()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2c_master_transfer_async </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>address</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>tx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>tx_size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>rx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>rx_size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initiate a non-blocking I2C master asynchronous transfer. </p>
<p >Supports simultaneous write and read operation.<br  />
</p>
<p >This will transfer <code>rx_size</code> bytes into the buffer pointed to by <code>rx</code>, while simultaneously transfering <code>tx_size</code> bytes of data from the buffer pointed to by <code>tx</code>, both in the background. When the requested quantity of data has been received, the <a class="el" href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79ac5b8050af1c08b0d00a21539c5286435">CYHAL_I2C_MASTER_RD_CMPLT_EVENT</a> will be raised. When the requested quantity of data has been transmitted, the <a class="el" href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79a0365270204869bfe80a2015258c979e1">CYHAL_I2C_MASTER_WR_CMPLT_EVENT</a> will be raised. See <a class="el" href="group__group__hal__i2c.html#gacf738716af52c484873e35331b9a30b7">cyhal_i2c_register_callback</a> and <a class="el" href="group__group__hal__i2c.html#ga6216658331d13dd8a854a23e96141fc7">cyhal_i2c_enable_event</a>. If either of <b>tx_size</b> or <b>rx_size</b> is '0', the respective write or read operation is not performed. See <a class="el" href="group__group__hal__i2c.html#subsection_i2c_snippet_3">Snippet 3: I2C Master Asynchronous Transfer</a></p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2C object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">address</td><td>device address (7-bit) </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">tx</td><td>The transmit buffer </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">tx_size</td><td>The number of bytes to transmit. Use '0' if write operation is not required. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">rx</td><td>The receive buffer </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">rx_size</td><td>The number of bytes to receive. Use '0' if read operation is not required. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the master_transfer_async request </dd></dl>

</div>
</div>
<a id="ga5ee41d9e5c6dc83376291ff5275c942a" name="ga5ee41d9e5c6dc83376291ff5275c942a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5ee41d9e5c6dc83376291ff5275c942a">&#9670;&nbsp;</a></span>cyhal_i2c_abort_async()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2c_abort_async </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Abort asynchronous transfer. </p>
<p ><br  />
 This function aborts the ongoing transfer by generating a stop condition.<br  />
 See <a class="el" href="group__group__hal__i2c.html#subsection_i2c_snippet_3">Snippet 3: I2C Master Asynchronous Transfer</a></p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2C object </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the abort_async request </dd></dl>

</div>
</div>
<a id="gacf738716af52c484873e35331b9a30b7" name="gacf738716af52c484873e35331b9a30b7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gacf738716af52c484873e35331b9a30b7">&#9670;&nbsp;</a></span>cyhal_i2c_register_callback()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_i2c_register_callback </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__i2c.html#ga67df812388aae9fcc3b3b1986dab7a09">cyhal_i2c_event_callback_t</a>&#160;</td>
          <td class="paramname"><em>callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>callback_arg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Register an I2C event callback handler<br  />
 </p>
<p >This function will be called when one of the events enabled by <a class="el" href="group__group__hal__i2c.html#ga6216658331d13dd8a854a23e96141fc7">cyhal_i2c_enable_event</a> occurs.</p>
<p >See <a class="el" href="group__group__hal__i2c.html#subsection_i2c_snippet_2">Snippet 2: Handling events</a></p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2C object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>The callback handler which will be invoked when an event triggers </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">callback_arg</td><td>Generic argument that will be provided to the callback when called </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gaafc998a7480459a782345d4c20317072" name="gaafc998a7480459a782345d4c20317072"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaafc998a7480459a782345d4c20317072">&#9670;&nbsp;</a></span>cyhal_i2c_register_address_callback()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_i2c_register_address_callback </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__i2c.html#gaf1b10084a21b85fbc040238f0c205782">cyhal_i2c_address_callback_t</a>&#160;</td>
          <td class="paramname"><em>callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>callback_arg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Register an I2C address callback handler<br  />
 </p>
<p >This function will be called when one of the events enabled by <a class="el" href="group__group__hal__i2c.html#ga580008770cd8c2dfcc7c919d25ba9904">cyhal_i2c_enable_address_event</a> occurs. NOTE: This function will not have an effect if enable_address_callback parameter of <a class="el" href="group__group__hal__i2c.html#structcyhal__i2c__adv__cfg__t">cyhal_i2c_adv_cfg_t</a> structure was false when <a class="el" href="group__group__hal__i2c.html#ga374725474725fa84841feedf11eb5359">cyhal_i2c_configure_adv</a> was called.</p>
<p >See <a class="el" href="group__group__hal__i2c.html#subsection_i2c_snippet_2">Snippet 2: Handling events</a></p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2C object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>The callback handler which will be invoked when an event triggers </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">callback_arg</td><td>Generic argument that will be provided to the callback when called </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga6216658331d13dd8a854a23e96141fc7" name="ga6216658331d13dd8a854a23e96141fc7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6216658331d13dd8a854a23e96141fc7">&#9670;&nbsp;</a></span>cyhal_i2c_enable_event()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_i2c_enable_event </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__i2c.html#gaaba7daccaa3861c32a4b0284e8194a79">cyhal_i2c_event_t</a>&#160;</td>
          <td class="paramname"><em>event</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>intr_priority</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>enable</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Configure and Enable or Disable I2C Interrupt. </p>
<p >When an enabled event occurs, the function specified by <a class="el" href="group__group__hal__i2c.html#gacf738716af52c484873e35331b9a30b7">cyhal_i2c_register_callback</a> will be called.</p>
<p >See <a class="el" href="group__group__hal__i2c.html#subsection_i2c_snippet_2">Snippet 2: Handling events</a></p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2C object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">event</td><td>The I2C event type </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">intr_priority</td><td>The priority for NVIC interrupt events </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">enable</td><td>True to turn on interrupts, False to turn off </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga580008770cd8c2dfcc7c919d25ba9904" name="ga580008770cd8c2dfcc7c919d25ba9904"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga580008770cd8c2dfcc7c919d25ba9904">&#9670;&nbsp;</a></span>cyhal_i2c_enable_address_event()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_i2c_enable_address_event </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__i2c.html#ga10f472dd5ea523332e85610d903a020c">cyhal_i2c_addr_event_t</a>&#160;</td>
          <td class="paramname"><em>event</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>intr_priority</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>enable</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Configure and Enable or Disable I2C Address Interrupt. </p>
<p >When an enabled event occurs, the function specified by <a class="el" href="group__group__hal__i2c.html#gaafc998a7480459a782345d4c20317072">cyhal_i2c_register_address_callback</a> will be called.</p>
<p >See <a class="el" href="group__group__hal__i2c.html#subsection_i2c_snippet_2">Snippet 2: Handling events</a></p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2C object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">event</td><td>The I2C address event type </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">intr_priority</td><td>The priority for NVIC interrupt events </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">enable</td><td>True to turn on interrupts, False to turn off </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga28d8b90e912067afa2be1ad63e0e26bf" name="ga28d8b90e912067afa2be1ad63e0e26bf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga28d8b90e912067afa2be1ad63e0e26bf">&#9670;&nbsp;</a></span>cyhal_i2c_set_fifo_level()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2c_set_fifo_level </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__i2c.html#gaa59a59acf36a7815929230f07ea3f8e9">cyhal_i2c_fifo_type_t</a>&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>level</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets a threshold level for a FIFO that will generate an interrupt and a trigger output. </p>
<p >The RX FIFO interrupt and trigger will be activated when the receive FIFO has more entries than the threshold. The TX FIFO interrupt and trigger will be activated when the transmit FIFO has less entries than the threshold.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2C object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">type</td><td>FIFO type to set level for </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">level</td><td>Level threshold to set </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the level set </dd></dl>

</div>
</div>
<a id="gaf2012311623f37e679e8af020481429a" name="gaf2012311623f37e679e8af020481429a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf2012311623f37e679e8af020481429a">&#9670;&nbsp;</a></span>cyhal_i2c_enable_output()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2c_enable_output </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__i2c.html#ga67be23b92e99d5314fe8158d8ea51611">cyhal_i2c_output_t</a>&#160;</td>
          <td class="paramname"><em>output</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__triggers__psoc6__01.html#ga96236d1368f920d28af90262e8b57046">cyhal_source_t</a> *&#160;</td>
          <td class="paramname"><em>source</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enables the specified output signal from an I2C. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2C object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">output</td><td>Which output signal to enable </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">source</td><td>Pointer to user-allocated source signal object which will be initialized by enable_output. <code>source</code> should be passed to (dis)connect_digital functions to (dis)connect the associated endpoints. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the output enable </dd></dl>

</div>
</div>
<a id="gaf1b47ca281e0d070cd62b7ad1ba6a576" name="gaf1b47ca281e0d070cd62b7ad1ba6a576"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf1b47ca281e0d070cd62b7ad1ba6a576">&#9670;&nbsp;</a></span>cyhal_i2c_disable_output()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2c_disable_output </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__i2c.html#ga67be23b92e99d5314fe8158d8ea51611">cyhal_i2c_output_t</a>&#160;</td>
          <td class="paramname"><em>output</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Disables the specified output signal from an I2C. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2C object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">output</td><td>Which output signal to disable </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the output disable </dd></dl>

</div>
</div>
<a id="ga947fbdc21502765223abd57241354103" name="ga947fbdc21502765223abd57241354103"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga947fbdc21502765223abd57241354103">&#9670;&nbsp;</a></span>cyhal_i2c_init_cfg()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2c_init_cfg </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__configurator__t">cyhal_i2c_configurator_t</a> *&#160;</td>
          <td class="paramname"><em>cfg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the I2C peripheral using a configurator generated configuration struct. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2C peripheral to configure </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">cfg</td><td>Configuration structure generated by a configurator. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the operation </dd></dl>

</div>
</div>
<a id="gaecffe10cd89c910f06aa321a05c8e07a" name="gaecffe10cd89c910f06aa321a05c8e07a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaecffe10cd89c910f06aa321a05c8e07a">&#9670;&nbsp;</a></span>cyhal_i2c_slave_readable()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t cyhal_i2c_slave_readable </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the number of bytes written by the I2C master. </p>
<p >Calling the <a class="el" href="group__group__hal__i2c.html#ga2642bdcfecb06786c438801bbc6ed844">cyhal_i2c_slave_config_write_buffer</a> API will clear the counter of bytes sent by master</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2C object </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of bytes written by the I2C master. </dd></dl>

</div>
</div>
<a id="gad1bb4fe709608bf15b67c36a89f512d1" name="gad1bb4fe709608bf15b67c36a89f512d1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad1bb4fe709608bf15b67c36a89f512d1">&#9670;&nbsp;</a></span>cyhal_i2c_slave_writable()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t cyhal_i2c_slave_writable </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the number of bytes can be read by the I2C master. </p>
<p >Calling the <a class="el" href="group__group__hal__i2c.html#ga1f1570c650c1ddd12a8ffb6081dd56bb">cyhal_i2c_slave_config_read_buffer</a> API will clear the counter of bytes read by master</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2C object </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of bytes can be read by the I2C master. </dd></dl>

</div>
</div>
<a id="ga1e8bbbd32b1a1ef83dcaa3b3384ef59a" name="ga1e8bbbd32b1a1ef83dcaa3b3384ef59a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1e8bbbd32b1a1ef83dcaa3b3384ef59a">&#9670;&nbsp;</a></span>cyhal_i2c_slave_read()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2c_slave_read </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>dst_buff</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t *&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>timeout</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Wait for master send data to RX buffer and store them to the user-defined buffer. </p>
<p >NOTE: If size of actual data is less then expected the function copy only available data.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2C object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">dst_buff</td><td>Pointer on memory to store the data from the slave RX buffer. </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">size</td><td>[in] The number of bytes to read, [out] number actually read. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">timeout</td><td>Timeout in millisecond, set this value to 0 if you don't want to wait at all. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the read request </dd></dl>

</div>
</div>
<a id="gaed1d72355cabfdc91285192931e99a95" name="gaed1d72355cabfdc91285192931e99a95"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaed1d72355cabfdc91285192931e99a95">&#9670;&nbsp;</a></span>cyhal_i2c_slave_write()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2c_slave_write </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>src_buff</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t *&#160;</td>
          <td class="paramname"><em>size</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>timeout</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Write data from the user-defined buffer to I2C TX buffer. </p>
<p >NOTE: If size of actual data is less then expected the function copy only available data.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2C object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">src_buff</td><td>Pointer on memory to copy the data to the slave TX buffer. </td></tr>
    <tr><td class="paramdir">[in,out]</td><td class="paramname">size</td><td>[in] The number of bytes to send, [out] number actually sent. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">timeout</td><td>Timeout in millisecond, set this value to 0 if you don't want to wait at all. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the write request </dd></dl>

</div>
</div>
<a id="ga1a2d189b083ad0f59d106a60ac99b632" name="ga1a2d189b083ad0f59d106a60ac99b632"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1a2d189b083ad0f59d106a60ac99b632">&#9670;&nbsp;</a></span>cyhal_i2c_slave_abort_read()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2c_slave_abort_read </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The function aborts the configured slave read buffer to be read by the master. </p>
<p >If the master reads and "abort operation" is requested, the <a class="el" href="group__group__hal__i2c.html#ggaaba7daccaa3861c32a4b0284e8194a79af1d3cec9a44b25d6d1434b9d21457cf2">CYHAL_I2C_SLAVE_RD_BUF_EMPTY_EVENT</a> event occurs.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2C object</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the slave_abort_read request </dd></dl>

</div>
</div>
<a id="ga779f80bdb9befe92968ecfaf6edbdca9" name="ga779f80bdb9befe92968ecfaf6edbdca9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga779f80bdb9befe92968ecfaf6edbdca9">&#9670;&nbsp;</a></span>cyhal_i2c_clear()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_i2c_clear </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__i2c__t">cyhal_i2c_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Clear the I2C buffers. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The I2C object </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the clear request </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>Hardware Abstraction Layer (HAL)</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
